-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartup.sh
More file actions
executable file
·32 lines (26 loc) · 954 Bytes
/
startup.sh
File metadata and controls
executable file
·32 lines (26 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# FlexPBX Service Startup Script
# This script is triggered when a remote desktop client successfully connects
echo "🚀 Starting FlexPBX services..."
# Set working directory
cd "$(dirname "$0")/.."
# Start background services
if [ -f "config/config.php" ]; then
echo "✅ Configuration found - starting services"
# Start PHP built-in cron system
if [ ! -f "temp/cron.pid" ]; then
nohup php cron/runner.php > logs/cron.log 2>&1 &
echo $! > temp/cron.pid
echo "⏰ Cron system started (PID: $(cat temp/cron.pid))"
fi
# Start main server process
if [ ! -f "temp/server.pid" ]; then
nohup php -S 0.0.0.0:8080 -t . > logs/server.log 2>&1 &
echo $! > temp/server.pid
echo "🌐 Server started (PID: $(cat temp/server.pid))"
fi
echo "🎉 All services started successfully"
else
echo "❌ Configuration not found - please run installer first"
exit 1
fi