]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blob - shell/bash_profile
45f744f4d8cb6220034b648a6b4170d5ecb1a7a6
[projects/pld-ftp-admin.git] / shell / bash_profile
1 # .bash_profile - file executed when logging in
2
3 # identify via remote addr
4 case "${SSH_CLIENT%% *}" in
5 84.50.110.50) # glen ;)
6         export FTPADM=glen
7 esac
8
9 # identify via terminal last login (su, sudo)
10 if [ -z "$FTPADM" ]; then
11         LAST_TTY=$(tty)
12         LAST_LOGIN=$(last -if /var/run/utmpx | awk -vtty="${LAST_TTY#/dev/}" '$2 == tty && $0 ~ /still logged in/ { print $1; exit; }')
13         export FTPADM=$LAST_LOGIN
14 fi
15
16 # per-admin defaults
17 case "$FTPADM" in
18 glen)
19         export TZ=EET
20         case $(id -un) in
21         pldth)
22                 echo -ne "\033kth@ftp\033\\"
23                 ;;
24         fpldac|pldac)
25                 echo -ne "\033kac@ftp\033\\"
26                 ;;
27         esac
28         ;;
29 '')
30         export FTPADM=$USER
31         ;;
32 esac
33
34 # let each ftp admin have own bash history
35 if [ "$FTPADM" ]; then
36         export HISTFILE=$HOME/.history-$FTPADM
37 fi
38 export EDITOR=vim
This page took 0.036523 seconds and 2 git commands to generate.