fix scripts with sudo

This commit is contained in:
2025-02-24 15:57:20 +01:00
parent f2467ad75e
commit f814f5aa29
7 changed files with 30 additions and 40 deletions

View File

@@ -46,12 +46,12 @@ chmod 700 "$SSH_DIR"
# Generate SSH key
if [ -f "$KEY_PATH" ]; then
echo "Error: Key file $KEY_PATH already exists."
exit 1
echo "Skipping: Key file $KEY_PATH already exists."
exit 0
fi
ssh-keygen -t ed25519 -C "$COMMENT" -f "$KEY_PATH" -N ""
echo "SSH key created: $KEY_PATH"
echo "SSH key created at: $KEY_PATH"
echo "Public key:"
cat "$KEY_PATH.pub"