From f3d92a6349a6db00c10090669b9232d522492701 Mon Sep 17 00:00:00 2001 From: Sefinek Date: Sat, 18 Jan 2025 03:58:37 +0100 Subject: [PATCH] Fixes --- install.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index ba18c40..1c4b8dc 100644 --- a/install.sh +++ b/install.sh @@ -162,6 +162,11 @@ else exit 1 fi +# Create logs directory +echo "📂 Creating /var/log/ufw-abuseipdb directory..." +sudo mkdir -p /var/log/ufw-abuseipdb +sudo chown "$USER":"$USER" /var/log/ufw-abuseipdb -R + # Change permissions for UFW log file echo "🔒 Changing permissions for $ufw_log_path..." sudo chmod 644 "$ufw_log_path" @@ -174,23 +179,18 @@ sudo npm uninstall corepack -g -silent echo "📦 Installing PM2..." sudo npm install pm2 -g -silent -# Create logs directory -echo "📂 Creating /var/log/ufw-abuseipdb directory..." -sudo mkdir -p /var/log/ufw-abuseipdb -sudo chown "$USER":"$USER" /var/log/ufw-abuseipdb -R - # Configure PM2 -echo "⚙️ Configuring PM2..." +echo "⚙️ Adding PM2 to autostart..." startup_command=$(pm2 startup | grep "sudo env PATH" | sed 's/^[^s]*sudo/sudo/') if [ -n "$startup_command" ]; then - echo "🔧 Executing PM2 startup command..." - echo "📝 $startup_command" + echo "⚙️ $startup_command..." eval "$startup_command" else echo "❌ Failed to find the command generated by 'pm2 startup'! PM2 was not added to autostart." fi +echo "⚙️ Running PM2 save..." pm2 save