Panel/_agent-linux/includes/ogp_agent.init
copilot-swe-agent[bot] 08f83918f1 Fix server offline issue by updating OGP references to match agent changes
Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
2025-09-05 23:02:41 +00:00

43 lines
682 B
Bash

#!/bin/bash
# Generic Init script if we can't find what kind of Linux we're on
agent_dir=OGP_AGENT_DIR
agent_user=OGP_USER
# Start function.
start() {
echo "Starting Game Server Agent..."
cd $agent_dir
su -c "screen -d -m -t agent -c screenrc -S agent ./agent_run -pidfile agent_run.pid" $agent_user &> $agent_dir/agent.svc &
echo
}
# Stop function.
stop() {
echo "Stopping Game Server Agent..."
kill `cat $agent_dir/agent_run.pid`
}
restart() {
stop
start
}
case $1 in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "Usage: ogp_agent {start|stop|restart}"
exit 1
;;
esac
exit 0;