diff options
author | Jason Graham <jgraha8@gmail.com> | 2017-12-31 14:12:58 -0500 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-01-01 20:28:37 +0700 |
commit | 8014473bdffce919d5a4a29dd73822c47792c82e (patch) | |
tree | 8fb80ab6bf444b3371eaf8e345c0ac7593f20517 /network/krb5/rc.kadmind | |
parent | a859d2ecd62d0f6210d0fdb7627ed6df8d1ce069 (diff) |
network/krb5: Added krb5kdc and kadmind init scripts.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/krb5/rc.kadmind')
-rw-r--r-- | network/krb5/rc.kadmind | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/network/krb5/rc.kadmind b/network/krb5/rc.kadmind new file mode 100644 index 0000000000000..5a5633f1eed72 --- /dev/null +++ b/network/krb5/rc.kadmind @@ -0,0 +1,54 @@ +#!/bin/sh +# +# Kerberos KADM5 administration server init script +# +# Copyright (C) 2017 Jason Graham <jgraha8@gmail.com> +# + +# Start kadmind: +kadmind_start() { + CMDLINE="/usr/sbin/kadmind" + echo -n "Starting kadmind: $CMDLINE" + $CMDLINE + echo +} + +# Stop kadmind: +kadmind_stop() { + echo "Stopping kadmind..." + killall -e -q kadmind +} + +# Restart kadmind: +kadmind_restart() { + kadmind_stop + sleep 1 + kadmind_start +} + +# Check if kadmind is running +kadmind_status() { + if [ ! -z "$(ps -e -o command | grep -E -w [/]usr/sbin/kadmind)" ]; then + echo "kadmind is running." + else + echo "kadmind is stopped." + exit 1 + fi +} + +case "$1" in + 'start') + kadmind_start + ;; + 'stop') + kadmind_stop + ;; + 'restart') + kadmind_restart + ;; + 'status') + kadmind_status + ;; + *) + echo "usage $0 start|stop|restart|status" +esac |