Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/sbin/runscript
- depend() {
- use net
- }
- start() {
- ebegin "Starting Dedicated Server (Port: ${GS_PORT}, Type: ${GS_TYPE}, Game: ${GS_GAME}, MaxPlayers: ${GS_MP})"
- if [ -n "${PID}" ]; then
- eerror "Already running"
- eend 0
- else
- su -c "screen -ls | grep -sq '\.${GS_TYPE}_${GS_GAME}_${GS_PORT}[[:space:]]' || screen -dmS ${GS_TYPE}_${GS_GAME}_${GS_PORT}" - gameserver
- su -c "screen -S ${GS_TYPE}_${GS_GAME}_${GS_PORT} -X screen ${GS_SPATH}/gameserver start" - gameserver
- eend $?
- fi
- }
- stop() {
- ebegin "Stopping Dedicated Server (Port: ${GS_PORT}, Type: ${GS_TYPE}, Game: ${GS_GAME}, MaxPlayers: ${GS_MP})"
- su -c "screen -S ${GS_TYPE}_${GS_GAME}_${GS_PORT} -X screen ${GS_SPATH}/gameserver stop" - gameserver
- eend $?
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement