aboutsummaryrefslogtreecommitdiff
path: root/system/lapsus/rc.lapsus
blob: a9c0c6ded7ac4f4d3fef08da9ac976f33260cd78 (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
#!/bin/sh
# Start/stop/restart lapsus.
# $Id: rc.lapsus,v 1.0 2007/11/28
# Author: Heinz Wiesinger <hmwiesinger@gmx.at>
# ---------------------------------------------------------------------------

# Start lapsus:
lapsus_start() {
  if [ -x /usr/sbin/lapsusd ]; then
    echo "Starting lapsus daemon:  /usr/sbin/lapsusd "
    /usr/sbin/lapsusd
  fi
}

# Stop lapsus:
lapsus_stop() {
  echo "Stopping lapsus daemon"
  killall lapsusd 1> /dev/null 2> /dev/null
}

# Restart lapsus:
lapsus_restart() {
  lapsus_stop
  sleep 1
  lapsus_start
}

case "$1" in
'start')
  lapsus_start
  ;;
'stop')
  lapsus_stop
  ;;
'restart')
  lapsus_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac