source: trunk/debathena/config/ssh-server-config/debian/10-bash-kerberos-credentials-warn @ 24038

Revision 24038, 989 bytes checked in by broder, 15 years ago (diff)
Miscellaneous, minor cleanups in shell-config.
Line 
1# If a user logs in without tickets and tokens, display a warning
2# message to let them know
3
4# Check to make sure the user does not have a local account, and that
5# it's an interactive login
6if [ "$DEBATHENA_HOME_TYPE" = "afs" ] && [ "$PS1" ]; then
7    tickets=
8    tokens=
9
10    # Check for tokens
11    if tokens | grep -q 'athena\.mit\.edu'; then
12        tokens="yes"
13    fi
14
15    # Check for tickets
16    if klist -s; then
17        tickets="yes"
18    fi
19
20    if [ -z "$tokens" ] && [ -z "$tickets" ] && [ ! -r ~/.bashrc ]; then
21        echo "WARNING: You have no valid Kerberos tickets and no valid AFS tokens." >&2
22        echo "See http://debathena.mit.edu/ssh" >&2
23    elif [ -z "$tokens" ] && [ ! -r ~/.bashrc ]; then
24        echo "WARNING: You have no valid AFS tokens." >&2
25        echo "See http://debathena.mit.edu/ssh" >&2
26    elif [ -z "$tickets" ]; then
27        echo "WARNING: You have no valid Kerberos tickets." >&2
28        echo "See http://debathena.mit.edu/ssh" >&2
29    fi
30fi
Note: See TracBrowser for help on using the repository browser.