zephyr-post-receive: Translate Git trailing space highlighting
[snippets/.git] / kerberos / krbroot
1 #!/bin/sh
2 export KRB5CCNAME=/tmp/krb5cc_$(id -u).root
3 export KRBTKFILE=/tmp/tkt$(id -u).root
4
5 case $1 in
6     init)
7         shift;
8         exec kinit -F -5 -l15m -r15m $USER/root@ATHENA.MIT.EDU "$@"
9         ;;
10     destroy)
11         exec kdestroy -45
12         ;;
13     shell)
14         klist -s || krbroot init || exit 1;
15         HOST="`hostname` (krbroot)" pagsh -c $SHELL
16         ;;
17     ssh)
18         klist -s || krbroot init || exit 1;
19         shift
20         exec ssh -k -l root "$@"
21         ;;
22     rlogin)
23         klist -s || krbroot init || exit 1;
24         exec rlogin -x -l root $2
25         ;;
26     *)
27         if [ $# = 0 ]; then
28             echo "Usage: $0 init" >&2
29             echo "       $0 destroy" >&2
30             echo "       $0 shell" >&2
31             echo "       $0 ssh [args]" >&2
32             echo "       $0 rlogin [args]" >&2
33             echo "       $0 [cmd]" >&2
34         else
35             exec "$@"
36         fi
37         ;;
38 esac