1 # .bash_profile - file executed when logging in
3 # identify via remote addr
4 #case "${SSH_CLIENT%% *}" in
5 #192.168.1.1) # ftpadmin
6 # export FTPADM=ftpadmin
10 # identify via terminal last login (su, sudo)
11 if [ -z "$FTPADM" ]; then
13 LAST_LOGIN=$(last -if /var/run/utmp | awk -vtty="${LAST_TTY#/dev/}" '$2 == tty && $0 ~ /still logged in/ { print $1; exit; }')
14 export FTPADM=$LAST_LOGIN
15 unset LAST_TTY LAST_LOGIN
25 # let each ftp admin have own history file
26 if [ "$FTPADM" ]; then
27 export HISTFILE=$HOME/.history-$FTPADM
28 export CDHISTFILE=$HOME/.cd_history-$FTPADM
32 PATH=$PATH:~/tld-ftp-admin/bin