summaryrefslogtreecommitdiff
path: root/network/heimdal/config/rc.kdc
blob: 3233794801a634ea4b7131f1c12ccc8fd4998656 (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

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

kdc_stop() {
  killall kdc
}

kdc_restart() {
  kdc_stop
  sleep 1
  kdc_start
}

case "$1" in
  'start')
    kdc_start
  ;;
  'stop')
    kdc_stop
  ;;
  'restart')
    kdc_restart
  ;;
  *)
    echo "Usage: $0 start|stop|restart"
  ;;
esac