Fix: Non-interactive mode and proper indentation

This commit is contained in:
nmemmert committed 2025-12-04 10:39:00 -05:00
1 parent 9db4ebd892
commit 05cde0a471
1 file changed
+12
+12
View File
@@ -33,11 +33,17 @@ echo " - Install dependencies"
echo " - Set up systemd service" echo " - Set up systemd service"
echo " - Open firewall port 3001" echo " - Open firewall port 3001"
echo "" echo ""
# Skip confirmation if running non-interactively or with -y flag
if [ -t 0 ]; then
read -p "Continue? (y/n) " -n 1 -r read -p "Continue? (y/n) " -n 1 -r
echo "" echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1 exit 1
fi fi
else
echo "Running in non-interactive mode, continuing..."
fi
# Update system # Update system
echo "" echo ""
@@ -101,6 +107,9 @@ echo "⚙️ Step 7: Setting up configuration..."
if [ ! -f ".env" ]; then if [ ! -f ".env" ]; then
cp .env.example .env cp .env.example .env
echo "✅ Created .env file" echo "✅ Created .env file"
# Skip interactive config if running non-interactively
if [ -t 0 ]; then
echo "" echo ""
echo "📝 Configure your settings:" echo "📝 Configure your settings:"
read -p "Enable email notifications? (y/n) " -n 1 -r read -p "Enable email notifications? (y/n) " -n 1 -r
@@ -131,6 +140,9 @@ if [ ! -f ".env" ]; then
sed -i "s/WEBHOOK_ENABLED=false/WEBHOOK_ENABLED=true/" .env sed -i "s/WEBHOOK_ENABLED=false/WEBHOOK_ENABLED=true/" .env
sed -i "s|WEBHOOK_URL=https://your-webhook-url.com|WEBHOOK_URL=$WEBHOOK_URL|" .env sed -i "s|WEBHOOK_URL=https://your-webhook-url.com|WEBHOOK_URL=$WEBHOOK_URL|" .env
fi fi
else
echo "⚠️ Running non-interactively. You can configure notifications later in $INSTALL_DIR/.env"
fi
else else
echo "✅ .env file already exists" echo "✅ .env file already exists"
fi fi