Update install.sh

This commit is contained in:
Sefinek committed 2025-04-13 17:24:27 +02:00
1 parent 226c2bf9fc
commit 6331be2cf9
1 file changed
+5 -4
+5 -4
View File
@@ -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