File: shellinabox.init

package info (click to toggle)
shellinabox 2.21%2Breally2.21-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,268 kB
  • sloc: ansic: 8,775; makefile: 355; sh: 309; ruby: 76; xml: 5
file content (46 lines) | stat: -rwxr-xr-x 1,467 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/lib/init/init-d-script
### BEGIN INIT INFO
# Provides:          shellinabox
# Required-Start:    $network $remote_fs
# Required-Stop:     $network $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Shell In A Box Daemon
# Description:       Daemon for publishing a login shell at
#                    http://localhost:PORT
#		     where default port number is 4200.
### END INIT INFO

# Authors: Markus Gutschke <markus@shellinabox.com>, Marc Singer <elf@buici.com>

DESC="Shell In A Box Daemon"
NAME="shellinabox"
DAEMON="/usr/bin/shellinaboxd"
COMMAND_NAME="shellinaboxd"
PIDFILE="/run/shellinaboxd.pid"

# Set some default values
CERTDIR="/var/lib/shellinabox"
PORT="4200"

do_start_prepare() {
  [ -d "$CERTDIR" ] || install -m 755 -o "$U" -g "$G" -d "$CERTDIR"
  DAEMON_ARGS="${DAEMON_ARGS:---background --pidfile $PIDFILE -u shellinabox -g shellinabox -c $CERTDIR -p $PORT --user-css-dir /etc/shellinabox/options-enabled $OPTS}"
}
do_restart_prepare() { do_start_prepare; }

#
#       Function that reloads the config file for the daemon/service.
#
do_reload_cmd() {
  # Only reload if there are no active sessions running
  [ -r "$PIDFILE" ] &&
    [ `ps o pid= --ppid "\`cat "$PIDFILE"\`\`ps o pid= --ppid \
                                                \\\`cat "$PIDFILE"\\\`|
                                             xargs -r -n 1 printf ',%s'\`" |
       wc -l` -gt 1 ] &&
    return 1

  do_stop
  do_start
}