Refactor backup script to create only necessary directories and update SSH config file creation logic
This commit is contained in:
@@ -22,7 +22,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create necessary directories
|
# Create necessary directories
|
||||||
mkdir -p "$SSH_CONFIG_DIR" "$SSH_HOST_KEYS_DIR"
|
mkdir -p "$SSH_HOST_KEYS_DIR"
|
||||||
|
|
||||||
# Generate host keys if they don't exist
|
# Generate host keys if they don't exist
|
||||||
for key_type in rsa ed25519; do
|
for key_type in rsa ed25519; do
|
||||||
@@ -36,7 +36,7 @@ for key_type in rsa ed25519; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -f $SSH_CONFIG_FILE ]; then
|
if [ ! -f $SSH_CONFIG_FILE ]; then
|
||||||
|
|
||||||
cat >"$SSH_CONFIG_FILE" <<EOF
|
cat >"$SSH_CONFIG_FILE" <<EOF
|
||||||
Port $SSH_PORT
|
Port $SSH_PORT
|
||||||
|
Reference in New Issue
Block a user