mirror of
https://github.com/Ponce/slackbuilds
synced 2024-12-04 00:56:07 +01:00
8014473bdf
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
54 lines
848 B
Bash
54 lines
848 B
Bash
#!/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
|