mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-14 21:56:41 +01:00
8014473bdf
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
54 lines
826 B
Bash
54 lines
826 B
Bash
#!/bin/sh
|
|
#
|
|
# Kerberos V5 KDC init script
|
|
#
|
|
# Copyright (C) 2017 Jason Graham <jgraha8@gmail.com>
|
|
#
|
|
|
|
# Start krb5kdc:
|
|
krb5kdc_start() {
|
|
CMDLINE="/usr/sbin/krb5kdc"
|
|
echo -n "Starting krb5kdc: $CMDLINE"
|
|
$CMDLINE
|
|
echo
|
|
}
|
|
|
|
# Stop krb5kdc:
|
|
krb5kdc_stop() {
|
|
echo "Stopping krb5kdc..."
|
|
killall -e -q krb5kdc
|
|
}
|
|
|
|
# Restart krb5kdc:
|
|
krb5kdc_restart() {
|
|
krb5kdc_stop
|
|
sleep 1
|
|
krb5kdc_start
|
|
}
|
|
|
|
# Check if krb5kdc is running
|
|
krb5kdc_status() {
|
|
if [ ! -z "$(ps -e -o command | grep -E -w [/]usr/sbin/krb5kdc)" ]; then
|
|
echo "krb5kdc is running."
|
|
else
|
|
echo "krb5kdc is stopped."
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
case "$1" in
|
|
'start')
|
|
krb5kdc_start
|
|
;;
|
|
'stop')
|
|
krb5kdc_stop
|
|
;;
|
|
'restart')
|
|
krb5kdc_restart
|
|
;;
|
|
'status')
|
|
krb5kdc_status
|
|
;;
|
|
*)
|
|
echo "usage $0 start|stop|restart|status"
|
|
esac
|