summaryrefslogtreecommitdiff
path: root/development/regina-rexx/rc.rxstack
blob: 13a59166a579d9b5b016ecb4d1fc824c70ed1388 (plain)
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
47
48
49
50
#!/bin/sh
#
# description: Regina Stack daemon.
# processname: rxstack

# 2014-06-09 R Narron  Rewrite for Slackware 

DAEMON=/usr/bin/rxstack
RETVAL=0

# start rxstack
rxstack_start() {
  if [ -x $DAEMON ]; then
    echo -n "Starting Regina Stack: $DAEMON"
    $DAEMON -d
    RETVAL=$?
  fi
}

# stop rxstack
rxstack_stop() {
  echo -n "Shutting down Regina Stack: "
  killall -2 $DAEMON
  RETVAL=$?
}

# restart rxstack
rxstack_restart() {
  rxstack_stop
  sleep 1
  rxstack_start
  RETVAL=$?
}

case "$1" in
  start)
    rxstack_start
    ;;
  stop)
    rxstack_stop
    ;;
  restart)
    rxstack_restart
    ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
    RETVAL=1
esac

exit $RETVAL