Small fixes
This commit is contained in:
1 parent
41f43d3ff1
commit
92eef15f0a
1 file changed
+7
-8
+7
-8
@@ -120,15 +120,14 @@ if yes_no_prompt "🛠️ Do you want the script to run apt update and apt upgra
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Clone repository
|
# Clone repository
|
||||||
if [ -d "/home" ]; then
|
if [ ! -d "/opt" ]; then
|
||||||
mkdir -p /home/new_directory
|
mkdir -p /opt
|
||||||
echo "📂 '/home/new_directory' has been created"
|
echo "📂 '/opt' has been created"
|
||||||
else
|
else
|
||||||
echo "❌ '/home' directory does not exist. Exiting..."
|
echo "✅ '/opt' directory already exists"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /home || { echo "❌ Failed to change directory to '/home'. Exiting..."; exit 1; }
|
cd /opt || { echo "❌ Failed to change directory to '/opt'. Exiting..."; exit 1; }
|
||||||
|
|
||||||
if [ ! -d "UFW-AbuseIPDB-Reporter" ]; then
|
if [ ! -d "UFW-AbuseIPDB-Reporter" ]; then
|
||||||
echo "📥 Cloning the UFW-AbuseIPDB-Reporter repository..."
|
echo "📥 Cloning the UFW-AbuseIPDB-Reporter repository..."
|
||||||
@@ -185,7 +184,7 @@ pm2 startup
|
|||||||
|
|
||||||
# Execute the command generated by pm2 startup
|
# Execute the command generated by pm2 startup
|
||||||
echo "🔧 Complete pm2 startup configuration:"
|
echo "🔧 Complete pm2 startup configuration:"
|
||||||
sudo env PATH="$PATH":/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u "$USER" --hp /home/"$USER"
|
sudo env PATH="$PATH":/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u "$USER" --hp /opt/"$USER"
|
||||||
|
|
||||||
pm2 save
|
pm2 save
|
||||||
|
|
||||||
@@ -197,8 +196,8 @@ pm2 status
|
|||||||
echo -e "\n🎉 Installation and configuration completed!"
|
echo -e "\n🎉 Installation and configuration completed!"
|
||||||
|
|
||||||
echo -e "\n====================================== Summary ======================================"
|
echo -e "\n====================================== Summary ======================================"
|
||||||
echo "🔑 API Token : $api_token"
|
|
||||||
echo "🖥️ Server ID : ${server_id:-null}"
|
echo "🖥️ Server ID : ${server_id:-null}"
|
||||||
|
echo "🔑 API Token : $api_token"
|
||||||
echo "📂 Script : $PWD"
|
echo "📂 Script : $PWD"
|
||||||
echo "⚙️ Config File : $PWD/config.js"
|
echo "⚙️ Config File : $PWD/config.js"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user