# CONFIGURATION
kdo_args=(-l15m -r60m -F)
-# CC interface for OS X
-if [ "Darwin" = "$(uname)" ]; then
+# CC interface for OS X or modern MIT krb5
+if type kswitch &>/dev/null; then
kcaches () {
klist -A | perl -ne '$cache = $1 if /^(?:Kerberos 5 ticket|Ticket|Credentials) cache: '\''?(.*)'\''?/; print "$1 $cache\n" if /^(?:Default p|P)rincipal: (.*)$/'
}
# If kcaches and knewcache have been defined for this platform, then
# setup kdo. Otherwise, add a helpful error.
-if hash kcaches &>/dev/null && hash knewcache &>/dev/null; then
+if type kcaches &>/dev/null && type knewcache &>/dev/null; then
kfindcache () {
kcaches | fgrep "$1" | cut -d' ' -f2-
}
COMPREPLY=($(compgen -c -- "${cur}"))
esac
}
- complete -o bashdefault -F _kdo kdo
+ if type complete &>/dev/null; then
+ complete -o bashdefault -F _kdo kdo
+ fi
else
kdo () {