aboutsummaryrefslogtreecommitdiffstats
path: root/bin/ldap-krb5
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@fripost.org>2012-09-25 00:55:39 +0200
committerGuilhem Moulin <guilhem.moulin@fripost.org>2012-09-25 00:55:39 +0200
commit7672946edb73d485e5eb0ffd75964f2cea2caaa0 (patch)
tree76d64779110b3f94dd54112d932c0e0f51e98363 /bin/ldap-krb5
parentc5abfa216d18d374e493fd309a1f4748af094e50 (diff)
A script to start/stop the web panel and ask automatically renew the kerberos ticket.
Diffstat (limited to 'bin/ldap-krb5')
-rwxr-xr-xbin/ldap-krb525
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/ldap-krb5 b/bin/ldap-krb5
new file mode 100755
index 0000000..368db8e
--- /dev/null
+++ b/bin/ldap-krb5
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Keep renewing/recreating kerberos tickets for ldap/hostname
+
+if [ $(id -u) -ne 0 ]; then
+ echo "Error: You are not root"
+ exit 1
+fi
+
+. /etc/default/slapd
+KSTART="k5start -b -f ${KRB5_KTNAME} -u ldap -i $(hostname --fqdn) -q -K 60"
+case "${1}" in
+ start)
+ pgrep -U "${SLAPD_USER}" -G "${SLAPD_GROUP}" -fx "${KSTART}" >/dev/null \
+ || sudo -u "${SLAPD_USER}" ${KSTART} \
+ || exit 1
+ ;;
+ stop)
+ pkill -U "${SLAPD_USER}" -G "${SLAPD_GROUP}" -fx "${KSTART}" >/dev/null \
+ ;;
+ *)
+ echo "Usage: $0 {start|stop}" >&2
+ exit 1
+ ;;
+esac