diff --git a/install.sh b/install.sh index 168212c..00268fb 100644 --- a/install.sh +++ b/install.sh @@ -134,6 +134,7 @@ while true; do server_id=null break elif [[ $server_id =~ ^[A-Za-z0-9]{1,16}$ ]]; then + server_id="'$server_id'" break else echo "❌ It must be 1-16 characters long, contain only letters and numbers, and have no spaces or special characters." @@ -185,9 +186,9 @@ fi config_file="config.js" if [[ -f $config_file ]]; then echo "🔧 Updating $PWD/$config_file..." - sed -i "s|UFW_LOG_FILE: .*|UFW_LOG_FILE: '$ufw_log_path',|" $config_file - sed -i "s|SERVER_ID: .*|SERVER_ID: '$server_id',|" $config_file - sed -i "s|ABUSEIPDB_API_KEY: .*|ABUSEIPDB_API_KEY: '$api_token',|" $config_file + sed -i "s|UFW_LOG_FILE: .*|UFW_LOG_FILE: '$ufw_log_path',|" "$config_file" + sed -i "s|SERVER_ID: .*|SERVER_ID: $server_id,|" "$config_file" + sed -i "s|ABUSEIPDB_API_KEY: .*|ABUSEIPDB_API_KEY: '$api_token',|" "$config_file" else echo "❌ $config_file not found. Make sure the repository was cloned and initialized correctly." exit 1 @@ -206,7 +207,7 @@ sudo chmod 644 "$ufw_log_path" # Install PM2 echo "📦 Installing PM2..." -sudo npm install pm2 -g -silent +sudo npm install pm2 -g --silent # Configure PM2