geomyidae

A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log | Files | Refs | README | LICENSE

commit b3b6d54e4122244a89b50987b122a135b6b40586
parent 866af53f96a6cc52a99b7103f72a8e31dedaee84
Author: Christoph Lohmann <20h@r-36.net>
Date:   Sun, 29 Apr 2012 08:24:01 +0200

Optimizing the rc.d.

Diffstat:
rc.d/Archlinux.rc.d | 55++++++++++++++++++++++++++++---------------------------
1 file changed, 28 insertions(+), 27 deletions(-)

diff --git a/rc.d/Archlinux.rc.d b/rc.d/Archlinux.rc.d @@ -4,33 +4,34 @@ . /etc/rc.d/functions . /etc/conf.d/geomyidae -PID=`pidof -o %PPID /usr/bin/geomyidae` +PID=$(pidof -o %PPID /usr/bin/geomyidae) case "$1" in - start) - stat_busy "Starting geomyidae" - [ -z "$PID" ] && /usr/bin/geomyidae $GEOMYIDAE_ARGS 2>&1 - if [ $? -gt 0 ]; then - stat_fail - else - add_daemon geomyidae - stat_done - fi - ;; - stop) - stat_busy "Stopping geomyidae" - [ ! -z "$PID" ] && kill $PID &>/dev/null - if [ $? -gt 0 ]; then - stat_fail - else - rm_daemon geomyidae - stat_done - fi - ;; - restart) - $0 stop - $0 start - ;; - *) - echo "usage: $0 {start|stop|restart}" + start) + stat_busy "Starting geomyidae" + [ -z "$PID" ] && /usr/bin/geomyidae $GEOMYIDAE_ARGS 2>&1 + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon geomyidae + stat_done + fi + ;; + stop) + stat_busy "Stopping geomyidae" + [ -n "$PID" ] && kill $PID &>/dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon geomyidae + stat_done + fi + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" esac exit 0 +