* Fixed and amended the gogopherd.sh init script.
authorUrban Wallasch <urban.wallasch@freenet.de>
Fri, 12 Apr 2019 19:15:26 +0000 (21:15 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Fri, 12 Apr 2019 19:15:26 +0000 (21:15 +0200)
gogopherd.sh

index 1354cf60a32d5e84091f5da935dada12f6933198..9d997cf916f24884e7c490cca65c1a2255763f78 100755 (executable)
@@ -1,29 +1,33 @@
 #!/bin/sh
 
 ### BEGIN INIT INFO
-# Provides:        gopherd
-# Required-Start:  $network
-# Required-Stop:   $network
-# Default-Start:   2 3 4 5
-# Default-Stop:
-# Short-Description: Start gopher server
+# Provides:          gogopherd
+# Required-Start:    $local_fs $remote_fs $network $named
+# Required-Stop:     $local_fs $remote_fs $network $named
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: gogopherd gopher server
+# Description:       Start and stop the gogopherd gopher server using start-stop-daemon.
 ### END INIT INFO
 
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-
-. /lib/lsb/init-functions
-
 PREFIX=/usr/local
 
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
 DAEMON="$PREFIX/bin/gogopherd"
 CFGFILE="$PREFIX/etc/gogopherd.cfg"
+DFLTFILE="$PREFIX/etc/default/gogopherd"
+GOGOPTS="-c $CFGFILE"
+DESC="gogopher server"
+NAME=gogopherd
 PIDFILE=/var/run/gogopherd.pid
-GOGOPTS="$GOGOPTS -c $CFGFILE"
+LOCKFILE=/run/lock/gogopherd
 
-test -x $DAEMON || exit 5
-test -f $CFGFILE || exit 5
+[ -x "$DAEMON" ] || exit 5
+[ -r "$CFGFILE" ] || exit 5
+[ -r "$DFLTFILE" ] && . "$DFLTFILE"
 
-LOCKFILE=/run/lock/gogopherd
+. /lib/lsb/init-functions
 
 case $1 in
        start)