Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37815994
en ru br
ALT Linux repos
S:2.20-alt2

Group :: Networking/Remote access
RPM: shellinabox

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh
#
# shellinabox This shell script takes care of starting and stopping
# shellinabox.
#
# chkconfig: 345 95 05
# description: Publish command line shell through AJAX interface.
# config: /etc/template.conf
# pidfile: /var/run/shellinaboxd.pid

### BEGIN INIT INFO
# Provides: shellinabox
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Publish command line shell through AJAX interface.
# Description: Publish command line shell through AJAX interface.
### END INIT INFO

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

RUN_AS=%runas
PIDFILE=/var/run/shellinaboxd.pid
SourceIfExists /etc/sysconfig/shellinaboxd

LOCKFILE=/var/lock/subsys/shellinabox
RETVAL=0

start()
{
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user "$RUN_AS" -- shellinaboxd --background=$PIDFILE $OPTIONS
RETVAL=$?
return $RETVAL
}

stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user "$RUN_AS" -- shellinaboxd
RETVAL=$?
return $RETVAL
}

restart()
{
stop
start
}

reload()
{
msg_reloading shellinaboxd
stop_daemon --pidfile "$PIDFILE" --expect-user "$RUN_AS" -HUP -- shellinaboxd
RETVAL=$?
return $RETVAL
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
condreload)
if [ -e "$LOCKFILE" ]; then
reload
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user "$RUN_AS" -- shellinaboxd
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
RETVAL=1
esac

exit $RETVAL
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin