pld-ftp-admin: shell/bash_profile - more detecting

glen glen at pld-linux.org
Mon Jan 10 21:12:22 CET 2011


Author: glen                         Date: Mon Jan 10 20:12:22 2011 GMT
Module: pld-ftp-admin                 Tag: HEAD
---- Log message:
- more detecting

---- Files affected:
pld-ftp-admin/shell:
   bash_profile (1.7 -> 1.8) 

---- Diffs:

================================================================
Index: pld-ftp-admin/shell/bash_profile
diff -u pld-ftp-admin/shell/bash_profile:1.7 pld-ftp-admin/shell/bash_profile:1.8
--- pld-ftp-admin/shell/bash_profile:1.7	Sat Feb 13 20:53:36 2010
+++ pld-ftp-admin/shell/bash_profile	Mon Jan 10 21:12:17 2011
@@ -1,7 +1,7 @@
 # .bash_profile - file executed when logging in
 
 case "${SSH_CLIENT%% *}" in
-194.106.120.90|84.50.110.50) # glen ;)
+84.50.110.50) # glen ;)
 	export EDITOR=vim
 	export TZ=EET
 	export FTPADM=glen
@@ -14,3 +14,23 @@
 		;;
 	esac
 esac
+
+if [ -z "$FTPADM" ]; then
+	LAST_TTY=$(tty)
+	LAST_LOGIN=$(last -if /var/run/utmpx | awk -vtty="${LAST_TTY#/dev/}" '$2 == tty && $0 ~ /still logged in/ { print $1; exit; }')
+	case "$LAST_LOGIN" in
+		arekm)
+			export EDITOR=vim
+			export FTPADM=arekm
+		;;
+	esac
+fi
+
+if [ -z "$FTPADM" ]; then
+	FTPADM=$USER
+fi
+
+# let each ftp admin have own bash history
+if [ "$FTPADM" ]; then
+	export HISTFILE=$HOME/.history-$FTPADM
+fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-ftp-admin/shell/bash_profile?r1=1.7&r2=1.8&f=u



More information about the pld-cvs-commit mailing list