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
+15 -3
+15 -3
View File
@@ -33,10 +33,16 @@ echo " - Install dependencies"
echo " - Set up systemd service"
echo " - Open firewall port 3001"
echo ""
read -p "Continue? (y/n) " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
# Skip confirmation if running non-interactively or with -y flag
if [ -t 0 ]; then
read -p "Continue? (y/n) " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
else
echo "Running in non-interactive mode, continuing..."
fi
# Update system
@@ -101,6 +107,9 @@ echo "⚙️ Step 7: Setting up configuration..."
if [ ! -f ".env" ]; then
cp .env.example .env
echo "✅ Created .env file"
# Skip interactive config if running non-interactively
if [ -t 0 ]; then
echo ""
echo "📝 Configure your settings:"
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_URL=https://your-webhook-url.com|WEBHOOK_URL=$WEBHOOK_URL|" .env
fi
else
echo "⚠️ Running non-interactively. You can configure notifications later in $INSTALL_DIR/.env"
fi
else
echo "✅ .env file already exists"
fi