lilalo
changeset 8:56e8b17b1823
lm-install поправлен.
* Исправлено вычисление имени пользователя
для chown ~/.labmaker после инсталляции.
* Ничего не добавляется в профайл, всё чере basrhc
* PS1 меняется до exec
* Исправлено вычисление имени пользователя
для chown ~/.labmaker после инсталляции.
* Ничего не добавляется в профайл, всё чере basrhc
* PS1 меняется до exec
author | devi |
---|---|
date | Sun May 29 12:40:51 2005 +0300 (2005-05-29) |
parents | 614945eed906 |
children | 868607af758e |
files | lm-install |
line diff
1.1 --- a/lm-install Tue May 24 16:25:24 2005 +0300 1.2 +++ b/lm-install Sun May 29 12:40:51 2005 +0300 1.3 @@ -73,19 +73,19 @@ 1.4 1.5 this_term=`w | grep "${TTY##/dev/}" | awk '{print $8;}'` 1.6 # freeBSD: 1.7 - this_term=`w | grep "${TTY##/dev/tty}" | awk '{print $6;}'` 1.8 + #this_term=`w | grep "${TTY##/dev/tty}" | awk '{print $6;}'` 1.9 if [ -n "$this_term" ] && echo $this_term | grep -qv script 1.10 then 1.11 LMHOME=~/.labmaker 1.12 mkdir -p ${LMHOME} 1.13 flush="-f" #linux 1.14 - flush="-t 0" #freebsd 1.15 + #flush="-t 0" #freebsd 1.16 + PS1='\[` a="$?"; 1.17 + HIDDEN=$([ "$a" = 0 ] || echo -n ^"$a")$(echo -n _${UID}_)$(echo -n _$$_)$(date\ 1.18 + +"%j$(cat ~/.labmaker/lab 2>/dev/null) %H:%M:%S"); 1.19 + echo $HIDDEN`\033[50D\033[K\][\u@\h:\W]\$ ' 1.20 exec script $flush -q $LMHOME/${TTY##*/}-$$.script 1.21 fi 1.22 - PS1='\[` a="$?"; 1.23 - HIDDEN=$([ "$a" = 0 ] || echo -n ^"$a")$(echo -n _${UID}_)$(echo -n _$$_)$(date\ 1.24 - +"%j$(cat ~/.labmaker/lab 2>/dev/null) %H:%M:%S"); 1.25 - echo $HIDDEN`\033[50D\033[K\][\u@\h:\W]\$ ' 1.26 # LabMaker:END 1.27 LM_bash_profile 1.28 cat $temp_file > $profile 1.29 @@ -158,20 +158,24 @@ 1.30 exit 1.31 fi 1.32 1.33 - for user in $users_to_install 1.34 + for home in $users_to_install 1.35 do 1.36 - home=$user # fix this! 1.37 + # fix this! 1.38 + user=${home%/} 1.39 + user=${user##*/} 1.40 mkdir -p $home/.labmaker 1.41 echo $first_lab > $home/.labmaker/lab 1.42 - chown -R ${user##*/} $home/.labmaker 1.43 + chown -R $user $home/.labmaker 1.44 1.45 - if [ ! -e $home/.bash_profile ] 1.46 - then 1.47 - echo '. ~/.bashrc' >> ~/.bash_profile 1.48 - fi 1.49 - [ -e $home/.bash_profile ] \ 1.50 - && install_to_profile $home/.bash_profile \ 1.51 - && echo LabMaker is installed to $home/.bash_profile 1.52 + #if [ ! -e $home/.bash_profile ] 1.53 + #then 1.54 + # echo '. ~/.bashrc' >> ~/.bash_profile 1.55 + #fi 1.56 + #[ -e $home/.bash_profile ] \ 1.57 + # && install_to_profile $home/.bash_profile \ 1.58 + # && echo LabMaker is installed to $home/.bash_profile 1.59 + 1.60 + echo Don\'t forget to check .bash_profile for .bashrc call 1.61 1.62 [ -e $home/.profile ] && install_to_profile $home/.profile \ 1.63 && install_to_profile $home/.profile \ 1.64 @@ -200,13 +204,13 @@ 1.65 echo $first_lab > $home/.labmaker/lab 1.66 chown -R ${user##*/} $home/.labmaker 1.67 1.68 - if [ ! -e $home/.bash_profile ] 1.69 - then 1.70 - echo '. ~/.bashrc' >> ~/.bash_profile 1.71 - fi 1.72 - [ -e $home/.bash_profile ] \ 1.73 - && uninstall_from_profile $home/.bash_profile \ 1.74 - && echo LabMaker is uninstalled from $home/.bash_profile 1.75 + #if [ ! -e $home/.bash_profile ] 1.76 + #then 1.77 + # echo '. ~/.bashrc' >> ~/.bash_profile 1.78 + #fi 1.79 + #[ -e $home/.bash_profile ] \ 1.80 + # && uninstall_from_profile $home/.bash_profile \ 1.81 + # && echo LabMaker is uninstalled from $home/.bash_profile 1.82 1.83 [ -e $home/.profile ] && uninstall_from_profile $home/.profile \ 1.84 && uninstall_from_profile $home/.profile \