summaryrefslogtreecommitdiffstats
path: root/shellinabox
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2018-11-04 14:37:52 +0000
committer Eric Hameleers <alien@slackware.com>2018-11-04 14:37:52 +0000
commit9a6be3b5d3b2a877c1ee8c9e97276e0cf1007cd0 (patch)
treef0093314db1cbf4562fecbe9ac4ab3cd3b6586f8 /shellinabox
parent15b28c69a4ab09e161b06edc768a2510e1edbd40 (diff)
downloadasb-9a6be3b5d3b2a877c1ee8c9e97276e0cf1007cd0.tar.gz
asb-9a6be3b5d3b2a877c1ee8c9e97276e0cf1007cd0.tar.xz
Initial revision
Diffstat (limited to 'shellinabox')
-rw-r--r--shellinabox/build/rc.shellinabox74
1 files changed, 74 insertions, 0 deletions
diff --git a/shellinabox/build/rc.shellinabox b/shellinabox/build/rc.shellinabox
new file mode 100644
index 00000000..f3554794
--- /dev/null
+++ b/shellinabox/build/rc.shellinabox
@@ -0,0 +1,74 @@
+#!/bin/bash
+#
+# shellinabox This shell script takes care of starting and stopping
+# shellinabox.
+#
+# description: Publish command line shell through AJAX interface.
+# processname: shellinaboxd
+# config: /etc/sysconfig/shellinabox
+# pidfile: /var/run/shellinaboxd.pid
+
+# Source shellinabox configureation.
+if [ -f /etc/sysconfig/shellinabox ] ; then
+ . /etc/sysconfig/shellinabox
+fi
+
+RETVAL=0
+prog="shellinaboxd"
+SHELLINABOXD="/usr/sbin/$prog"
+LOCKFILE="/var/lock/subsys/shellinaboxd"
+PIDFILE="/var/run/shellinaboxd.pid"
+
+[ -f $SHELLINABOXD ] || exit 0
+
+start() {
+ echo -n $"Starting $prog: "
+ $SHELLINABOXD --background=$PIDFILE $DAEMON_OPTIONS
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch $LOCKFILE
+ return $RETVAL
+}
+
+stop() {
+ # Stop daemons.
+ echo -n $"Shutting down $prog: "
+ killall -TERM $prog
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
+ return $RETVAL
+}
+
+status() {
+ PIDS=$(pidof $prog)
+ if [ "$PIDS" == "" ]; then
+ echo "$prog is not running!"
+ else
+ echo "$prog is running at pid(s) ${PIDS}."
+ fi
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ RETVAL=$?
+ ;;
+ status)
+ status
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|status}"
+ exit 1
+esac
+
+exit $RETVAL