From 569f91e24e78261966bf91173c6f06dc0e8d6438 Mon Sep 17 00:00:00 2001 From: Amoelle Date: Sun, 20 Apr 2025 13:33:54 +0300 Subject: [PATCH] fix file copying --- scripts/generate_scripts.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/generate_scripts.sh b/scripts/generate_scripts.sh index 7737223..96f17f8 100755 --- a/scripts/generate_scripts.sh +++ b/scripts/generate_scripts.sh @@ -14,13 +14,13 @@ generate_client_scripts() { generate_main_client_script() { # Copy the script to the server - sudo cp "$DEPLOY_DIR/y" "$SERVER_ROOT" + cp "$DEPLOY_DIR/y" "$SERVER_ROOT" # Replace placeholders in the script sed -i "s|SERVER_PLACEHOLDER|$SERVER_IP|g" "$SERVER_ROOT/y" sed -i "s|TOKEN_PLACEHOLDER|$SECRET_TOKEN|g" "$SERVER_ROOT/y" - sudo chmod 644 "$SERVER_ROOT/y" + chmod 644 "$SERVER_ROOT/y" } generate_obfuscated_script() { @@ -28,10 +28,10 @@ generate_obfuscated_script() { # Base64 encode the script to obfuscate it base64 -w0 < "$DEPLOY_DIR/y" > "$DEPLOY_DIR/y.b64" - sed -i "s|BASE64_PLACEHOLDER|$(cat "$DEPLOY_DIR/y.b64")|g" "$DEPLOY_DIR/x" - sudo cp "$DEPLOY_DIR/x" "$SERVER_ROOT/" - sudo chmod 644 "$SERVER_ROOT/x" + cp "$DEPLOY_DIR/x" "$SERVER_ROOT/" + sed -i "s|y.b64|$(cat $SERVER_ROOT/y.b64)|g" "$SERVER_ROOT/x" + chmod 644 "$SERVER_ROOT/x" echo "Obfuscated script created." } @@ -42,8 +42,8 @@ generate_presets() { # Replace placeholders for preset in "$DEPLOY_DIR/minimal" "$DEPLOY_DIR/full" "$DEPLOY_DIR/quiet"; do sed -i "s|SERVER_PLACEHOLDER|$SERVER_IP|g" "$preset" - sudo cp "$preset" "$SERVER_ROOT/" - sudo chmod 644 "$SERVER_ROOT/$(basename "$preset")" + cp "$preset" "$SERVER_ROOT/" + chmod 644 "$SERVER_ROOT/$(basename "$preset")" done echo "Installation presets created."