Fix: Non-interactive mode and proper indentation
This commit is contained in:
1 parent
9db4ebd892
commit
05cde0a471
1 file changed
+12
@@ -33,11 +33,17 @@ echo " - Install dependencies"
|
||||
echo " - Set up systemd service"
|
||||
echo " - Open firewall port 3001"
|
||||
echo ""
|
||||
|
||||
# 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
|
||||
echo ""
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user