lilalo

diff lm-install @ 28:450b6ac9b657

Незначительные исправления:
* Исправлена обработка diff-файлов. Теперь они обрабатываются
в реальном времени
* Указан путь к mywi-client
* Исправлен путь к иконкам google/freebsd/linux
author devi
date Mon Nov 07 12:23:13 2005 +0200 (2005-11-07)
parents 05d496f33d76
children 4d252e7dd478
line diff
     1.1 --- a/lm-install	Tue Jun 28 09:16:07 2005 +0300
     1.2 +++ b/lm-install	Mon Nov 07 12:23:13 2005 +0200
     1.3 @@ -68,31 +68,54 @@
     1.4  		| sed '/LabMaker:START/,/LabMaker:END/ d' \
     1.5  		> $temp_file
     1.6  	cat <<'LM_bash_profile' >> $temp_file
     1.7 -	# LabMaker:START
     1.8 -	TTY=`tty` 
     1.9 +# LabMaker:START
    1.10 +LMHOME=~/.labmaker
    1.11 +mkdir -p ${LMHOME}
    1.12  
    1.13 -	uname -a | grep -qi bsd && bsd=yes
    1.14 +uname -a | grep -qi bsd && bsd=yes
    1.15 +flush="-f"			#linux
    1.16 +[ -n "$bsd" ] && flush="-t 0"	#freebsd
    1.17  
    1.18 -	this_term=`w | grep "${TTY##/dev/}" | awk '{print $8;}'`
    1.19 -	# freeBSD: 
    1.20 -	[ -n "$bsd" ] && this_term=`w | grep "${TTY##/dev/tty}" | awk '{print $6;}'`
    1.21 +tty=`tty` 
    1.22 +this_term=`w | grep "${tty##/dev/}" | awk '{print $8;}'`
    1.23 +# freeBSD: 
    1.24 +[ -n "$bsd" ] && this_term=`w | grep "${tty##/dev/tty}" | awk '{print $6;}'`
    1.25  
    1.26  
    1.27 +export PS1='\[`	
    1.28 +	a="$?";
    1.29 +	HIDDEN=$([ "$a" = 0 ] || echo -n ^"$a")$(echo -n _${UID}_)$(echo -n _$$_)$(date\
    1.30 +		+"%j$(cat ${LMHOME}/lab 2>/dev/null) %H:%M:%S");
    1.31 +	echo $HIDDEN`\033[50D\033[K\][\u@\h:\W]\$ '
    1.32  
    1.33 -	LMHOME=~/.labmaker
    1.34 -	mkdir -p ${LMHOME}
    1.35 -	flush="-f"	#linux
    1.36 -	[ -n "$bsd" ] && flush="-t 0"	#freebsd
    1.37 -	export PS1='\[`	a="$?";
    1.38 -		HIDDEN=$([ "$a" = 0 ] || echo -n ^"$a")$(echo -n _${UID}_)$(echo -n _$$_)$(date\
    1.39 -			+"%j$(cat ~/.labmaker/lab 2>/dev/null) %H:%M:%S");
    1.40 -		echo $HIDDEN`\033[50D\033[K\][\u@\h:\W]\$ '
    1.41 +if [ -n "$this_term" ] && echo $this_term | grep -qv script
    1.42 +then	
    1.43 +	session_id=${tty##*/}-$$
    1.44 +	parent=`cat /proc/$PPID/cmdline 2> /dev/null`
    1.45 +	system=`uname -rs`
    1.46 +	login_from=`who | grep "${tty##/dev/}" | awk '{print $6;}' | tr -d '()'`
    1.47 +	[ -n "$bsd" ] && login_from="" #FIXME!
    1.48 +	start_time=`date +%s`
    1.49 +	hostname=`hostname -f`
    1.50  
    1.51 -	if [ -n "$this_term" ] && echo $this_term | grep -qv script
    1.52 -	then	
    1.53 -		exec script $flush -q $LMHOME/${TTY##*/}-$$.script
    1.54 -	fi
    1.55 -	# LabMaker:END 
    1.56 +	cat <<INFO > $LMHOME/${session_id}.info
    1.57 +<session>
    1.58 +<session_id>$session_id</session_id>
    1.59 +<hostname>$hostname</hostname>
    1.60 +<user>$USER</user>
    1.61 +<login_from>$login_from</login_from>
    1.62 +<tty>$tty</tty>
    1.63 +<system>$system</system>
    1.64 +<parent>$parent</parent>
    1.65 +<ppid>$PPID</ppid>
    1.66 +<pid>$$</pid>
    1.67 +<start_time>$start_time</start_time>
    1.68 +</session>
    1.69 +INFO
    1.70 +
    1.71 +	exec script $flush -q $LMHOME/${session_id}.script
    1.72 +fi
    1.73 +# LabMaker:END 
    1.74  LM_bash_profile
    1.75  	cat $temp_file > $profile
    1.76  	rm $temp_file