lilalo

changeset 17:05d496f33d76

lm-install: проверка операционной системы на стороне клиента.
В зависимости от того FreeBSD это или Linux
нужно по-разному запускать script
author devi
date Tue Jun 28 09:16:07 2005 +0300 (2005-06-28)
parents 37d701f903ec
children 06260270cbe0
files lm lm-install
line diff
     1.1 --- a/lm	Thu Jun 16 11:44:38 2005 +0300
     1.2 +++ b/lm	Tue Jun 28 09:16:07 2005 +0300
     1.3 @@ -43,7 +43,7 @@
     1.4  	"sshkey"	=> "$ENV{HOME}/.ssh/id_dsa.pub",
     1.5  	"lmssh"		=> "./lm-ssh",
     1.6  	"lminstall"	=> "./lm-install",
     1.7 -	"ssh_user"	=> "r",
     1.8 +	"ssh_user"	=> "root",
     1.9  );
    1.10  
    1.11  our %Run = (
     2.1 --- a/lm-install	Thu Jun 16 11:44:38 2005 +0300
     2.2 +++ b/lm-install	Tue Jun 28 09:16:07 2005 +0300
     2.3 @@ -71,15 +71,18 @@
     2.4  	# LabMaker:START
     2.5  	TTY=`tty` 
     2.6  
     2.7 +	uname -a | grep -qi bsd && bsd=yes
     2.8 +
     2.9  	this_term=`w | grep "${TTY##/dev/}" | awk '{print $8;}'`
    2.10  	# freeBSD: 
    2.11 -	this_term=`w | grep "${TTY##/dev/tty}" | awk '{print $6;}'`
    2.12 +	[ -n "$bsd" ] && this_term=`w | grep "${TTY##/dev/tty}" | awk '{print $6;}'`
    2.13 +
    2.14  
    2.15  
    2.16  	LMHOME=~/.labmaker
    2.17  	mkdir -p ${LMHOME}
    2.18  	flush="-f"	#linux
    2.19 -	flush="-t 0"	#freebsd
    2.20 +	[ -n "$bsd" ] && flush="-t 0"	#freebsd
    2.21  	export PS1='\[`	a="$?";
    2.22  		HIDDEN=$([ "$a" = 0 ] || echo -n ^"$a")$(echo -n _${UID}_)$(echo -n _$$_)$(date\
    2.23  			+"%j$(cat ~/.labmaker/lab 2>/dev/null) %H:%M:%S");