summaryrefslogtreecommitdiff
path: root/network/heimdal/config/rc.kadmind
blob: 23b5447078a705383a1d9760f11c4432b045f92f (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
#!/bin/sh

kadmind_start() {
  if [ -x /usr/libexec/kadmind ]; then
    echo "Starting the kadmind service: /usr/libexec/kadmind"
    /usr/libexec/kadmind --detach
  fi
}

kadmind_stop() {
  killall kadmind
}

kadmind_restart() {
  kadmind_stop
  sleep 1
  kadmind_start
}

case "$1" in
  'start')
    kadmind_start
  ;;
  'stop')
    kadmind_stop
  ;;
  'restart')
    kadmind_restart
  ;;
  *)
    echo "Usage: $0 start|stop|restart"
  ;;
esac