Initial commit - Church Music Database
This commit is contained in:
53
legacy-site/scripts/shell/ubuntu-services.sh
Executable file
53
legacy-site/scripts/shell/ubuntu-services.sh
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Service Management Script for Church Song Lyric System
|
||||
|
||||
ACTION=$1
|
||||
|
||||
case $ACTION in
|
||||
start)
|
||||
echo "Starting services..."
|
||||
sudo systemctl start church-songlyric-backend
|
||||
sudo systemctl start nginx
|
||||
echo "Services started."
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping services..."
|
||||
sudo systemctl stop church-songlyric-backend
|
||||
sudo systemctl stop nginx
|
||||
echo "Services stopped."
|
||||
;;
|
||||
restart)
|
||||
echo "Restarting services..."
|
||||
sudo systemctl restart church-songlyric-backend
|
||||
sudo systemctl restart nginx
|
||||
echo "Services restarted."
|
||||
;;
|
||||
status)
|
||||
echo "=========================================="
|
||||
echo "Backend Service Status:"
|
||||
echo "=========================================="
|
||||
sudo systemctl status church-songlyric-backend --no-pager
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "Nginx Service Status:"
|
||||
echo "=========================================="
|
||||
sudo systemctl status nginx --no-pager
|
||||
;;
|
||||
logs)
|
||||
echo "Backend logs (Ctrl+C to exit):"
|
||||
sudo journalctl -u church-songlyric-backend -f
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status|logs}"
|
||||
echo ""
|
||||
echo " start - Start all services"
|
||||
echo " stop - Stop all services"
|
||||
echo " restart - Restart all services"
|
||||
echo " status - Show service status"
|
||||
echo " logs - Show backend logs (live)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user