This commit is contained in:
Sefinek committed 2025-01-18 03:58:37 +01:00
1 parent 2cc18a1cd1
commit f3d92a6349
1 file changed
+8 -8
+8 -8
View File
@@ -162,6 +162,11 @@ else
exit 1 exit 1
fi 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 # Change permissions for UFW log file
echo "🔒 Changing permissions for $ufw_log_path..." echo "🔒 Changing permissions for $ufw_log_path..."
sudo chmod 644 "$ufw_log_path" sudo chmod 644 "$ufw_log_path"
@@ -174,23 +179,18 @@ sudo npm uninstall corepack -g -silent
echo "📦 Installing PM2..." echo "📦 Installing PM2..."
sudo npm install pm2 -g -silent 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 # Configure PM2
echo "⚙️ Configuring PM2..." echo "⚙️ Adding PM2 to autostart..."
startup_command=$(pm2 startup | grep "sudo env PATH" | sed 's/^[^s]*sudo/sudo/') startup_command=$(pm2 startup | grep "sudo env PATH" | sed 's/^[^s]*sudo/sudo/')
if [ -n "$startup_command" ]; then if [ -n "$startup_command" ]; then
echo "🔧 Executing PM2 startup command..." echo "⚙️ $startup_command..."
echo "📝 $startup_command"
eval "$startup_command" eval "$startup_command"
else else
echo "❌ Failed to find the command generated by 'pm2 startup'! PM2 was not added to autostart." echo "❌ Failed to find the command generated by 'pm2 startup'! PM2 was not added to autostart."
fi fi
echo "⚙️ Running PM2 save..."
pm2 save pm2 save