diff options
author | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2012-09-04 12:32:46 -0300 |
---|---|---|
committer | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2012-09-04 12:32:46 -0300 |
commit | e85af5281f53c90932c7fe78660d3cabd14e8033 (patch) | |
tree | cdf504fce94bdc5791a2dde9ca928c2ef9dd1cae /pcr/mednafen-server/mednafen-serverd | |
parent | 1bd9d9093ce91658bb3ac0ad3d4d0cf0ba1f9223 (diff) | |
parent | 6110ce46051a4079d110268965fff1df7a73e770 (diff) | |
download | abslibre-e85af5281f53c90932c7fe78660d3cabd14e8033.tar.gz abslibre-e85af5281f53c90932c7fe78660d3cabd14e8033.tar.bz2 abslibre-e85af5281f53c90932c7fe78660d3cabd14e8033.zip |
Merge branch 'master' of ssh://gparabola/srv/git/abslibre
Diffstat (limited to 'pcr/mednafen-server/mednafen-serverd')
-rwxr-xr-x | pcr/mednafen-server/mednafen-serverd | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/pcr/mednafen-server/mednafen-serverd b/pcr/mednafen-server/mednafen-serverd new file mode 100755 index 000000000..d6033f6af --- /dev/null +++ b/pcr/mednafen-server/mednafen-serverd @@ -0,0 +1,41 @@ +#!/bin/bash + +# source application-specific settings +MED_ARGS= +[ -f /etc/mednafen-server/standard.conf ] && . /etc/mednafen-server/standard.conf + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=$(pidof -o %PPID /usr/bin/mednafen-server) +case "$1" in + start) + stat_busy "Starting Mednafen Server Daemon" + [ -z "$PID" ] && /usr/bin/mednafen-server ${MED_ARGS} >/var/log/mednafen-server.log 2>/var/log/mednafen-server.log.2 + PID=$(pidof -o %PPID /usr/bin/mednafen-server) + if [ -z "$PID" ]; then + stat_fail + else + add_daemon mednafen-server + stat_done + fi + ;; + stop) + stat_busy "Stopping Mednafen Server Daemon" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon mednafen-server + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 |