Журнал лабораторных работ

Содержание

Журнал

Вторник (09/29/15)

/dev/pts/0
13:24:50
#cat install | egrep 'if (which)? apt-get'
    if which apt-get >& /dev/null
13:28:46
#cat install | egrep 'if (which )?apt-get'
    if which apt-get >& /dev/null
13:28:55
#cat install | egrep 'if (which |locate )?apt-get'
    if which apt-get >& /dev/null
13:29:46
#egrep '([0-9]|[0-9]{2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9]{2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])' /etc
egrep: Непарная ) или \)
прошло 10 минут
13:40:07
#egrep R '(([0-9]|[0-9]{2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9]{2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])' /etc
egrep: (([0-9]|[0-9]{2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9]{2}|1[0-9]{2}|2[0-4][0-9]|25[0-5]): Нет такого файла или каталога
egrep: /etc: Это каталог
13:40:49
#egrep -R '(([0-9]|[0-9]{2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9]{2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])' /etc
/etc/exim4/conf.d/router/100_exim4-config_domain_literal:# <user@[10.11.12.13]>. The RFCs require this facility, but it is disabled
/etc/exim4/conf.d/router/200_exim4-config_primary:  ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 192.168.0.0/16 :\
/etc/exim4/conf.d/router/200_exim4-config_primary:                        172.16.0.0/12 : 10.0.0.0/8 : 169.254.0.0/16 :\
/etc/exim4/conf.d/router/200_exim4-config_primary:                      255.255.255.255
/etc/exim4/conf.d/main/02_exim4-config_options:# spamd_address = 127.0.0.1 783
/etc/exim4/conf.d/main/02_exim4-config_options:# Allow Exim to recognize addresses of the form "user@[10.11.12.13]",
/etc/exim4/exim4.conf.template:# spamd_address = 127.0.0.1 783
/etc/exim4/exim4.conf.template:# Allow Exim to recognize addresses of the form "user@[10.11.12.13]",
/etc/exim4/exim4.conf.template:# <user@[10.11.12.13]>. The RFCs require this facility, but it is disabled
/etc/exim4/exim4.conf.template:  ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 192.168.0.0/16 :\
...
/etc/networks:loopback  127.0.0.0
/etc/networks:link-local        169.254.0.0
/etc/trafshow:10.0.0.0/8        any             Red
/etc/trafshow:any               10.0.0.0/8      Red
/etc/trafshow:127.0.0.1/8       any             Red
/etc/trafshow:any               127.0.0.1/8     Red
/etc/trafshow:172.16.0.0/16     any             Red
/etc/trafshow:any               172.16.0.0/16   Red
/etc/trafshow:192.168.0.0/16    any             Red
/etc/trafshow:any               192.168.0.0/16  Red
13:41:30
#ps lax
F   UID   PID  PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND
4     0     1     0  20   0  10648   828 -      Ss   ?          0:05 init [2]
1     0     2     0  20   0      0     0 -      S    ?          0:00 [kthreadd]
1     0     3     2  20   0      0     0 -      S    ?          0:00 [ksoftirqd/0]
1     0     5     2  20   0      0     0 -      S    ?          0:00 [kworker/u:0]
1     0     6     2 -100  -      0     0 -      S    ?          0:00 [migration/0]
5     0     7     2 -100  -      0     0 -      S    ?          0:03 [watchdog/0]
1     0     8     2   0 -20      0     0 -      S<   ?          0:00 [cpuset]
1     0     9     2   0 -20      0     0 -      S<   ?          0:00 [khelper]
5     0    10     2  20   0      0     0 -      S    ?          0:00 [kdevtmpfs]
...
1  1000  8422  8351  20   0  18168   472 -      S+   pts/4      0:00 script -f -c l3script -q /home/user/.lilalo//23268255052826723467-1443508579.scr
0  1000  8423  8422  20   0  24288  2940 -      Ss+  pts/5      0:01 l3script
0     0  8484  8090  20   0  18164   844 -      S+   pts/0      0:00 script -f -c l3script -q /root/.lilalo//3142712904239407254-1443508637.script
1     0  8515  8484  20   0  18168   472 -      S+   pts/0      0:00 script -f -c l3script -q /root/.lilalo//3142712904239407254-1443508637.script
0     0  8516  8515  20   0  24064  2600 -      Ss   pts/6      0:02 l3script
0  1001  8537  8138  20   0  24264  2912 -      S+   pts/2      0:00 l3script
0  1002  8578  8222  20   0  24264  2848 -      S+   pts/3      0:00 l3script
0     0  9351  8516  20   0   7728   320 -      T    pts/6      0:00 cat
1     0 10294     2  20   0      0     0 -      S    ?          0:00 [kworker/0:1]
4     0 10870  8516  20   0  10536   844 -      R+   pts/6      0:00 ps lax
13:45:52
#ps lax | awk '$11~/?/'
awk: line 1: regular expression compile failed (missing operand)
?
13:47:16
#ps lax | awk '$11~/\?/'
4     0     1     0  20   0  10648   828 -      Ss   ?          0:05 init [2]
1     0     2     0  20   0      0     0 -      S    ?          0:00 [kthreadd]
1     0     3     2  20   0      0     0 -      S    ?          0:00 [ksoftirqd/0]
1     0     5     2  20   0      0     0 -      S    ?          0:00 [kworker/u:0]
1     0     6     2 -100  -      0     0 -      S    ?          0:00 [migration/0]
5     0     7     2 -100  -      0     0 -      S    ?          0:03 [watchdog/0]
1     0     8     2   0 -20      0     0 -      S<   ?          0:00 [cpuset]
1     0     9     2   0 -20      0     0 -      S<   ?          0:00 [khelper]
5     0    10     2  20   0      0     0 -      S    ?          0:00 [kdevtmpfs]
1     0    11     2   0 -20      0     0 -      S<   ?          0:00 [netns]
...
1  1000  5136     1  20   0  47736 10356 -      Ss   ?          4:46 l3-agent
1     0  8073     2  20   0      0     0 -      S    ?          0:01 [kworker/0:0]
4     0  8088  2258  20   0  71384  3800 -      Ss   ?          0:01 sshd: root@pts/0
4     0  8135  2258  20   0  71292  3616 -      Ss   ?          0:00 sshd: ivan [priv]
5  1001  8137  8135  20   0  71292  1864 -      S    ?          0:00 sshd: ivan@pts/2
4     0  8219  2258  20   0  71292  3624 -      Ss   ?          0:00 sshd: petr [priv]
5  1002  8221  8219  20   0  71292  1868 -      S    ?          0:00 sshd: petr@pts/3
4     0  8303  2258  20   0  71292  3620 -      Ss   ?          0:00 sshd: user [priv]
5  1000  8305  8303  20   0  71292  1876 -      S    ?          0:00 sshd: user@pts/4
1     0 10294     2  20   0      0     0 -      S    ?          0:00 [kworker/0:1]
13:47:33
#ps lax | awk '$11!~/\?/'
F   UID   PID  PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND
4     0  2282     1  20   0  18368   968 -      Ss+  tty1       0:00 /sbin/getty 38400 tty1
4     0  2283     1  20   0  18368   976 -      Ss+  tty2       0:00 /sbin/getty 38400 tty2
4     0  2284     1  20   0  18368   976 -      Ss+  tty3       0:00 /sbin/getty 38400 tty3
4     0  2285     1  20   0  18368   972 -      Ss+  tty4       0:00 /sbin/getty 38400 tty4
4     0  2286     1  20   0  18368   972 -      Ss+  tty5       0:00 /sbin/getty 38400 tty5
4     0  2287     1  20   0  18368   968 -      Ss+  tty6       0:00 /sbin/getty 38400 tty6
4     0  8090  8088  20   0  22168  2832 -      Ss   pts/0      0:00 -bash
0  1001  8138  8137  20   0  22600  3200 -      Ss   pts/2      0:00 -bash
0  1002  8222  8221  20   0  22600  3204 -      Ss   pts/3      0:00 -bash
...
1  1000  8422  8351  20   0  18168   472 -      S+   pts/4      0:00 script -f -c l3script -q /home/user/.lilalo//23268255052826723467-1443508579.script
0  1000  8423  8422  20   0  24288  2940 -      Ss+  pts/5      0:01 l3script
0     0  8484  8090  20   0  18164   844 -      S+   pts/0      0:00 script -f -c l3script -q /root/.lilalo//3142712904239407254-1443508637.script
1     0  8515  8484  20   0  18168   472 -      S+   pts/0      0:00 script -f -c l3script -q /root/.lilalo//3142712904239407254-1443508637.script
0     0  8516  8515  20   0  24064  2600 -      Ss   pts/6      0:02 l3script
0  1001  8537  8138  20   0  24264  2912 -      S+   pts/2      0:00 l3script
0  1002  8578  8222  20   0  24264  2848 -      S+   pts/3      0:00 l3script
0     0  9351  8516  20   0   7728   320 -      T    pts/6      0:00 cat
4     0 10896  8516  20   0  10536   844 -      R+   pts/6      0:00 ps lax
0     0 10897  8516  20   0   6764   608 -      S+   pts/6      0:00 awk $11!~/\?/
13:48:13
#cat passwd
cat: passwd: Нет такого файла или каталога
13:50:36
#cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
...
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
Debian-exim:x:101:103::/var/spool/exim4:/bin/false
user:x:1000:1000:user,,,:/home/user:/bin/bash
sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
ivan:x:1001:1001::/home/ivan:/bin/bash
petr:x:1002:1002::/home/petr:/bin/bash
13:50:46
#vi shell.sh
--- /dev/null	2015-09-25 17:22:43.884000009 +0300
+++ shell.sh	2015-09-29 14:58:12.172969889 +0300
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+uid=$ (grep '^UID_min' /etc/login.defs | awk '{print $2}')
13:58:12
#vi shell.sh
--- /tmp/l3-saved-8516.18859.1386	2015-09-29 14:58:33.060969858 +0300
+++ shell.sh	2015-09-29 15:05:14.516969728 +0300
@@ -1,3 +1,5 @@
 #!/bin/bash
 
-uid=$ (grep '^UID_min' /etc/login.defs | awk '{print $2}')
+uid=$(grep '^UID_min' /etc/login.defs | awk '{print $2}')
+users=$(awk -F: '$3>=1000 && $3!=65534 {print $1}' /etc/passwd)
+echo $users
14:05:14
#bash vi shell.sh
/usr/bin/vi: /usr/bin/vi: не могу запустить бинарный файл
14:05:20
#bash shell.sh
user ivan petr
14:05:33
#vi shell.sh
--- /tmp/l3-saved-8516.30590.32262	2015-09-29 15:05:49.972969915 +0300
+++ shell.sh	2015-09-29 15:10:45.444969893 +0300
@@ -3,3 +3,7 @@
 uid=$(grep '^UID_min' /etc/login.defs | awk '{print $2}')
 users=$(awk -F: '$3>=1000 && $3!=65534 {print $1}' /etc/passwd)
 echo $users
+for user in $users
+  do
+    usermod -s $1 $user
+  done	
14:10:45
#bash shell.sh
user ivan petr
Использование: usermod [параметры] ПОÐ
, --comment КОММЕНТАРИЙ     новое значение поля GECOS
  -d, --home ДОМ_КАТ            новый домашний каталог учётной записи
  -e, --expiredate ДАТА_УСТ     установить дату окончания действия
                                учётной записи в ДАТА_УСТ
  -f, --inactive НЕАКТИВНОСТЬ   установить период неактивности пароля после
                                устаревания учётной записи равным НЕАКТИВНОСТЬ
  -g, --gid ГРУППА              принудительно назначить первичную ГРУППУ
  -G, --groups ГРУППЫ           список дополнительных ГРУПП
...
                                имеющимся (не уникальным) UID
  -p, --password ПАРОоль для
                                учётной записи
  -R, --root КАТ_CHROOT         каталог, в который выполняется chroot
  -s, --shell ОБОолочка для учётной
                                записи
  -u, --uid UID                 новый UID для учётной записи
  -U, --unlock                  разблокировать учётную запись
  -Z, --selinux-user SEUSER     новое пользовательское сопоставление
                                SELinux для учётной записи
14:10:47
#vi shell.sh
--- /tmp/l3-saved-8516.26292.20704	2015-09-29 15:10:54.064969965 +0300
+++ shell.sh	2015-09-29 15:16:24.140969875 +0300
@@ -1,9 +1,8 @@
 #!/bin/bash
 
-uid=$(grep '^UID_min' /etc/login.defs | awk '{print $2}')
+uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}')
 users=$(awk -F: '$3>=1000 && $3!=65534 {print $1}' /etc/passwd)
-echo $users
 for user in $users
   do
-    usermod -s $1 $user
+  grep "^$user.*bash" /etc/passwd &> /dev/null || usermod -s $1 $user
   done	
14:16:24
#bash shell.sh

14:16:26
#vi shell.sh
14:20:21
#~

14:20:23
#chmod u+x shell.sh

14:22:08
#./shell.sh /bin/bash

14:22:30
#cat install
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:23:15
#cat install | sed -n '1,10p'
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
14:23:56
#cat install | sed '1,10d'
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
#
###############################################################################
lilalo_rc=.l3rc
lilalo_home=.lilalo
url_lilalo="http://xgu.ru/lilalo"
url_l3bashrc="${url_lilalo}"/l3bashrc
url_l3agent="${url_lilalo}"/l3-agent
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:24:28
#cat install | sed '//^$d'
sed: -e выражение #1, символ 3: неизвестная команда: `^'
14:24:46
#cat install | sed '/^$/d'
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:24:52
#cat install | sed '/^$/d'
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:25:08
#cat install | sed 's/step/STEP'
sed: -e выражение #1, символ 11: незавершенная команда `s'
14:25:50
#cat install | sed 's/step/STEP'
sed: -e выражение #1, символ 11: незавершенная команда `s'
14:26:17
#cat install | sed 's/step/STEP/'
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
STEP "Downloading l3prompt" ${wget} ${url_l3prompt}
STEP "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
STEP "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
STEP "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
STEP "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
STEP "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
STEP "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:26:22
#cat install | sed '1,10s/step/STEP/'
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:27:20
#cat install | sed '1,50s/step/STEP/'
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:27:37
#cat install | sed '157,$s/step/STEP/'
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
STEP "Downloading l3prompt" ${wget} ${url_l3prompt}
STEP "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
STEP "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
STEP "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
STEP "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
STEP "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
STEP "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:28:25
#cat install | tr 3 4
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=14-10-2014
lab=NT-LNet
install_l4bashrc_for_this_users=${users:-"root user"}  # users who will use l4agent and l4script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l4prompt" ${wget} ${url_l4prompt}
step "Downloading l4-agent" '${wget} ${url_l4agent}; ${wget} ${url_l4config_pm}; ${wget} ${url_l4config}'
step "Downloading perl modules for l4-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l4-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l4bashrc to users home directories" install_to_users_homes $install_l4bashrc_for_this_users
step "Adding l4bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l4bashrc_for_this_users
step "Adding l4-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l4bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:31:25
#cat install | tr 4 3
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2013
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:31:40
#cat install | tr 3 4
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=14-10-2014
lab=NT-LNet
install_l4bashrc_for_this_users=${users:-"root user"}  # users who will use l4agent and l4script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l4prompt" ${wget} ${url_l4prompt}
step "Downloading l4-agent" '${wget} ${url_l4agent}; ${wget} ${url_l4config_pm}; ${wget} ${url_l4config}'
step "Downloading perl modules for l4-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l4-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l4bashrc to users home directories" install_to_users_homes $install_l4bashrc_for_this_users
step "Adding l4bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l4bashrc_for_this_users
step "Adding l4-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l4bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:31:58
#cat install | tr 123 456
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=46-40-5044
lab=NT-LNet
install_l6bashrc_for_this_users=${users:-"root user"}  # users who will use l6agent and l6script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l6prompt" ${wget} ${url_l6prompt}
step "Downloading l6-agent" '${wget} ${url_l6agent}; ${wget} ${url_l6config_pm}; ${wget} ${url_l6config}'
step "Downloading perl modules for l6-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l6-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l6bashrc to users home directories" install_to_users_homes $install_l6bashrc_for_this_users
step "Adding l6bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l6bashrc_for_this_users
step "Adding l6-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l6bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:32:10
#cat install | tr -s l
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before instalation:
lilalo_user=13-10-2014
lab=NT-LNet
instal_l3bashrc_for_this_users=${users:-"root user"}  # users who wil use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Instaling perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make instal; cd ..; done; }'
step "Instaling l3bashrc to users home directories" instal_to_users_homes $instal_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " instal_to_users_bashrc $instal_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " instal_to_users_bash_profile $instal_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:32:59
#cat install | tr -s \n
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:33:11
#cat install | tr -s "\n"
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
14:33:23
#cat install | tr -d l
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variabes before instaation:
iao_user=13-10-2014
ab=NT-LNet
insta_3bashrc_for_this_users=${users:-"root user"}  # users who wi use 3agent and 3script
iao_context="/users/${iao_user}/${ab}/${hostname}"
...
step "Downoading 3prompt" ${wget} ${ur_3prompt}
step "Downoading 3-agent" '${wget} ${ur_3agent}; ${wget} ${ur_3config_pm}; ${wget} ${ur_3config}'
step "Downoading per modues for 3-agent" '{ for i in ${per_modues}; do ${wget} ${ur_per_modues}/$i.tar.gz; done; }'
step "Instaing per modues for 3-agent" '{ for i in ${per_modues}; do tar xvfz $i.tar.gz; cd $i*[^z]; per Makefie.PL; make; make insta; cd ..; done; }'
step "Instaing 3bashrc to users home directories" insta_to_users_homes $insta_3bashrc_for_this_users
step "Adding 3bashrc invocation to ~/.bashrc " insta_to_users_bashrc $insta_3bashrc_for_this_users
step "Adding 3-agent invocation to ~/.bash_profie " insta_to_users_bash_profie $insta_3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_fina_message
14:33:46
#cat install | tr -d [:punct:]
binsh
hostnamehostname
uname a  egrep qi freebsddarwin  hostnamehostname f
 Set this variables before installation
lilalouser13102014
labNTLNet
installl3bashrcforthisusersusersroot user   users who will use l3agent and l3script
lilalocontextuserslilalouserlabhostname
lilalorcl3rc
lilalohomelilalo
...
step Downloading l3prompt wget urll3prompt
step Downloading l3agent wget urll3agent wget urll3configpm wget urll3config
step Downloading perl modules for l3agent  for i in perlmodules do wget urlperlmodulesitargz done
step Installing perl modules for l3agent  for i in perlmodules do tar xvfz itargz cd iz perl MakefilePL make make install cd  done
step Installing l3bashrc to users home directories installtousershomes installl3bashrcforthisusers
step Adding l3bashrc invocation to bashrc  installtousersbashrc installl3bashrcforthisusers
step Adding l3agent invocation to bashprofile  installtousersbashprofile installl3bashrcforthisusers
cd
rm rf tempdir
showfinalmessage
14:34:14
#cat install | tr -c [:punct:]
tr: пропущен операнд после «[:punct:]»
При преобразовании необходимо задать две строки.
Попробуйте «tr --help» для получения более подробного описания.
14:34:27
#cat install | tr -cd [:punct:]

14:34:40
#cat install | tr -cd [:pune:]
tr: неверный класс символов «spfce»
14:35:02
#cat install | tr -cd [:punct:][:space:]
#!//
=``
 - |  - '(|)' || =` -`
###############################################################################
#
#     :
_=--
=-
____=${:-" "}  #
_="//${_}/${}/${}"
...
 " " ${} ${_}
 " -" '${} ${_}; ${} ${__}; ${} ${_}'
 "    -" '{    ${_};  ${} ${__}/$..; ; }'
 "    -" '{    ${_};    $..;  $*[^];  .; ;  ;  ..; ; }'
 "     " ___ $____
 "    ~/. " ___ $____
 " -   ~/._ " ____ $____
 /
 - ${_}
__
14:35:10
#cat install
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
прошло 47 минут
/dev/pts/7
15:22:34
#cat install
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
15:23:37
#ls
1  all  errors  install  privet.sh  report  shadow  shell.sh
15:25:11
#egrep [a-z] /etc/install
egrep: /etc/install: Нет такого файла или каталога
15:30:03
#egrep [a-z]*
install:# Set this variables before installation:
install:install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
install:apt_get_install_this="perl make libmodule-build-perl libc6-dev gcc"
install:apt_get_install_deps()
install:        apt-get install -y $apt_get_install_this
install:        echo "Please install this dependencies manually:"
install:        echo $apt_get_install_this
install:        echo "Have you installed this already (y/n)?"
install:            echo Please install the dependencies and rerun the script
install:install_to_users_homes()
install:install_to_users_bashrc()
install:install_to_users_bash_profile()
install:Installation is successfully completed.
install:temp_dir=/tmp/lilalo-install-temp-$$
install:step "Installing dependencies" apt_get_install_deps
install:step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
install:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
install:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
install:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
15:31:31
#install
install: пропущен операнд, задающий файл
Попробуйте «install --help» для получения более подробного описания.
15:31:55
#cat install
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
15:32:05
#cat install | egrep [a-z]*
install:# Set this variables before installation:
install:install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
install:apt_get_install_this="perl make libmodule-build-perl libc6-dev gcc"
install:apt_get_install_deps()
install:        apt-get install -y $apt_get_install_this
install:        echo "Please install this dependencies manually:"
install:        echo $apt_get_install_this
install:        echo "Have you installed this already (y/n)?"
install:            echo Please install the dependencies and rerun the script
install:install_to_users_homes()
install:install_to_users_bashrc()
install:install_to_users_bash_profile()
install:Installation is successfully completed.
install:temp_dir=/tmp/lilalo-install-temp-$$
install:step "Installing dependencies" apt_get_install_deps
install:step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
install:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
install:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
install:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
15:34:00
#cat install | egrep -v [a-z]*
errors:find: `/proc/9600/task/9600/fd/5': Нет такого файла или каталога
errors:find: `/proc/9600/task/9600/fdinfo/5': Нет такого файла или каталога
errors:find: `/proc/9600/fd/5': Нет такого файла или каталога
errors:find: `/proc/9600/fdinfo/5': Нет такого файла или каталога
install:#!/bin/sh
install:
install:hostname=`hostname`
install:uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
install:
install:###############################################################################
...
shadow:ivan:$6$s2MItv3w$DaqUWGuX0hhkoyyrjsk4AaNTBqaoNtEXhSv5Kb1eweFwhXz7D904ClisTP8QyMGlxNO0BqgRhAxg6ISCj/Yd40:16706:0:99999:7:::
shadow:petr:$6$Yc4IPhJI$k9TKWvNdctkI3RVwsO17bIG0BSTPipKfvUsiII/8UAwcd8kfVuQpa7DGE68DvGKy2.aJWWRxcgElPMGxs8pkt0:16706:0:99999:7:::
shell.sh:#!/bin/bash
shell.sh:
shell.sh:uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}')
shell.sh:users=$(awk -F: '$3>=1000 && $3!=65534 {print $1}' /etc/passwd)
shell.sh:for user in $users
shell.sh:  do
shell.sh:  grep "^$user.*bash" /etc/passwd &> /dev/null || usermod -s $1 $user
shell.sh:  done
15:35:49
#cat install | egrep ([a-z][A]Z)*
l3script: syntax error near unexpected token `[a-z][A]Z'
15:38:06
#cat install | egrep ([a-z][A-Z])*
l3script: syntax error near unexpected token `[a-z][A-Z]'
15:38:19
#cat install | grep '[a-z]'
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
lilalo_rc=.l3rc
lilalo_home=.lilalo
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
15:40:07
#cat install du -s * |sort -rn | awk '{print$1;}'
cat: du: Нет такого файла или каталога
Втр
Your
Your
www-data:*:16248:0:99999:7:::
whiteC='\033[1;37m'
whiteC='\033[1;37m'
wget=wget
wget=wget
/var/mail/ivan
...
{
{
}
}
}
}
{
{
{
{
15:45:21
#cat install | du -s * |sort -rn | awk '{print$1;}'
8
8
4
4
4
4
4
0
15:45:27
#cat install | egrep -s * |sort -rn | awk '{print$1;}'
shell.sh:users=$(awk
shell.sh:
shadow:www-data:*:16248:0:99999:7:::
shadow:uucp:*:16248:0:99999:7:::
shadow:user:$6$CkJHVC8E$ykTJUix/7qmcPBJgqnJtCHlWhYfEaImqXcQyeRrwYm6Xi4KaZSfb4FB20ocZ/VlrQzTR2wiEobMxT/OM/FXgd0:16248:0:99999:7:::
shadow:sys:*:16248:0:99999:7:::
shadow:sync:*:16248:0:99999:7:::
shadow:sshd:*:16248:0:99999:7:::
shadow:root:$6$ppY7xZxX$CnutMU4XxetHko6DW5K/ckfiA6CFeC0cbV/d6rrWE6F5iszqxAaQTwekH3.vBTQPNCakvqusvPcBecndLcbX8.:16248:0:99999:7:::
shadow:proxy:*:16248:0:99999:7:::
...
all:/proc/8138/attr/keycreate
all:/proc/8138/attr/fscreate
all:/proc/8138/attr/exec
all:/proc/8138/attr/current
all:/home/ivan/d4/d3/d1/users
all:/home/ivan/d4/d3/d1/f1
all:find:
all:find:
all:find:
all:find:
15:46:20
#sed /etc/install
^[[B^[[A^C
15:48:31
#sed 's/:.*//' etc/install
sed: невозможно прочитать etc/install: Нет такого файла или каталога
15:49:28
#sed 's/:.*//' /etc/install
sed: невозможно прочитать /etc/install: Нет такого файла или каталога
15:49:35
#ls
1  all  errors  install  privet.sh  report  shadow  shell.sh
15:50:10
#sed 's/:.*//' /root/install
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
15:50:18
#sed 's/:.*//' |sort -rn /root/install
Your current lilalo context is ${lilalo_context}/USER
whiteC='\033[1;37m'
wget=wget
    users="$@"
    users="$@"
    users="$@"
        user_home=`get_user_home "$user"`
        user_home=`get_user_home "$user"`
        user_home=`get_user_home "$user"`
Use commands
...
{
{
{
{
{
    } || \
    }
    {
    {
^[[B^[[A^C
15:51:52
#cat install | tr [[:punct:]] " " | tr [:upper:] [:lower:]
   bin sh
hostname  hostname
uname  a   egrep  qi   freebsd darwin      hostname  hostname  f
  set this variables before installation
lilalo user 13 10 2014
lab nt lnet
install l3bashrc for this users   users   root user      users who will use l3agent and l3script
lilalo context   users   lilalo user    lab    hostname
lilalo rc  l3rc
lilalo home  lilalo
...
step  downloading l3prompt    wget    url l3prompt
step  downloading l3 agent     wget    url l3agent     wget    url l3config pm     wget    url l3config
step  downloading perl modules for l3 agent     for i in   perl modules   do   wget    url perl modules   i tar gz  done
step  installing perl modules for l3 agent     for i in   perl modules   do tar xvfz  i tar gz  cd  i   z   perl makefile pl  make  make install  cd     done
step  installing l3bashrc to users home directories  install to users homes  install l3bashrc for this users
step  adding l3bashrc invocation to    bashrc   install to users bashrc  install l3bashrc for this users
step  adding l3 agent invocation to    bash profile   install to users bash profile  install l3bashrc for this users
cd
rm  rf   temp dir
show final message
15:54:08
#cat install | tr [[:punct:]] " " | tr [:upper:] [:lower:] | tr -s " "
 bin sh
hostname hostname
uname a egrep qi freebsd darwin hostname hostname f
 set this variables before installation
lilalo user 13 10 2014
lab nt lnet
install l3bashrc for this users users root user users who will use l3agent and l3script
lilalo context users lilalo user lab hostname
lilalo rc l3rc
lilalo home lilalo
...
step downloading l3prompt wget url l3prompt
step downloading l3 agent wget url l3agent wget url l3config pm wget url l3config
step downloading perl modules for l3 agent for i in perl modules do wget url perl modules i tar gz done
step installing perl modules for l3 agent for i in perl modules do tar xvfz i tar gz cd i z perl makefile pl make make install cd done
step installing l3bashrc to users home directories install to users homes install l3bashrc for this users
step adding l3bashrc invocation to bashrc install to users bashrc install l3bashrc for this users
step adding l3 agent invocation to bash profile install to users bash profile install l3bashrc for this users
cd
rm rf temp dir
show final message
15:54:30
#| tr " " 'n\'
l3script: syntax error near unexpected token `|'
15:54:59
#cat install | tr [[:punct:]] " " | tr [:upper:] [:lower:] | tr -s " " | tr " " "\n" | grep -v "^$" | egrep '^.{3,}$'
bin
hostname
hostname
uname
egrep
freebsd
darwin
hostname
hostname
set
...
install
l3bashrc
for
this
users
temp
dir
show
final
message
15:56:25
#cat install | tr [[:punct:]] " " | tr [:upper:] [:lower:] | tr -s " " | tr " " "\n" | grep -v "^$" | egrep '^.{3,}$' |sort |uniq
033
2014
31m
32m
37m
39m
755
adding
agent
agentx
...
wget
which
whitec
who
will
writing
xgu
xvfz
you
your
15:56:59
#cat install | tr [[:punct:]] " " | tr [:upper:] [:lower:] | tr -s " " | tr " " "\n" | grep -v "^$" | egrep '^.{3,}$' |sort |uniq -c
      4 033
      1 2014
      1 31m
      1 32m
      1 37m
      1 39m
      2 755
      2 adding
      8 agent
      1 agentx
...
      9 wget
      2 which
      2 whitec
      1 who
      2 will
      1 writing
      4 xgu
      1 xvfz
      3 you
      4 your
прошло 10 минут
16:07:46
#ls ~userlocate gog.jpg
ls: невозможно получить доступ к ~userlocate: Нет такого файла или каталога
ls: невозможно получить доступ к gog.jpg: Нет такого файла или каталога
16:08:06
#locate gog.jpg

16:08:14
#locate ogo.jpg
/home/user/ogo.jpg
16:08:29
#>~user/ogo2.jpg

16:09:22
#locate ogo.jpg
/home/user/ogo.jpg
16:09:26
#locate ogo2.jpg

16:11:07
#less /etc/cron.daily/locate
16:14:48
#/etc/cron.daily/locate

16:15:18
#find / -mmin -2 2> /dev/null
/var/cache/locate
/var/cache/locate/locatedb
/var/log/auth.log
/dev/xconsole
/dev/pts/8
/dev/pts/7
/dev/ptmx
/home/user/.lilalo/.report.dat
/root/.lilalo
/root/.lilalo/167576235141433108-1443532954.info
...
/proc/12241/stack
/proc/12241/cpuset
/proc/12241/cgroup
/proc/12241/oom_score
/proc/12241/oom_adj
/proc/12241/oom_score_adj
/proc/12241/loginuid
/proc/12241/sessionid
/proc/12241/coredump_filter
/proc/12241/io
16:16:41
#find / -mmin -2 2> /dev/null | grep -v 'proc'
/tmp
/var/log/auth.log
/var/log/syslog
/dev/xconsole
/dev/pts/8
/dev/pts/7
/dev/ptmx
/home/user/.lilalo/.report.dat
/root/.lilalo
/root/.lilalo/167576235141433108-1443532954.info
/root/.lilalo/.report.dat
/root/.lilalo/167576235141433108-1443532954.script
/root/.john/john.rec
16:17:24
#ls -lh /var/cache/locate/locatedb
-rw-r--r-- 1 root root 323K Сен 29 17:15 /var/cache/locate/locatedb
16:18:29
#file /var/cache/locate/locatedb
l3script: file: команда не найдена
16:19:55
#apt-get update
Получено:1 http://ftp.ua.debian.org wheezy Release.gpg [2 373 B]
Получено:2 http://security.debian.org wheezy/updates Release.gpg [1 554 B]
Получено:3 http://security.debian.org wheezy/updates Release [102 kB]
Получено:4 http://ftp.ua.debian.org wheezy-updates Release.gpg [1 554 B]
Получено:5 http://ftp.ua.debian.org wheezy Release [191 kB]
Получено:6 http://security.debian.org wheezy/updates/main Sources [195 kB]
Получено:7 http://ftp.ua.debian.org wheezy-updates Release [136 kB]
Получено:8 http://security.debian.org wheezy/updates/contrib Sources [14 B]
Получено:9 http://ftp.ua.debian.org wheezy/main Sources [5 982 kB]
Получено:10 http://security.debian.org wheezy/updates/non-free Sources [14 B]
...
Получено:32 http://ftp.ua.debian.org wheezy-updates/main Translation-en [3 814 B]
Получено:33 http://ftp.ua.debian.org wheezy-updates/non-free Translation-en [14 B]
Получено 17,2 MБ за 49с (350 kБ/c)
Чтение списков пакетов… Готово
W: Недоступен открытый ключ для следующих ID ключей:
9D6D8F6BC857C906
W: Недоступен открытый ключ для следующих ID ключей:
7638D0442B90D010
W: Недоступен открытый ключ для следующих ID ключей:
7638D0442B90D010
16:21:16
#apt-get install file
Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
Будут установлены следующие дополнительные пакеты:
  libmagic1
НОВЫЕ пакеты, которые будут установлены:
  file libmagic1
обновлено 0, установлено 2 новых пакетов, для удаления отмечено 0 пакетов, и 66 пакетов не обновлено.
Необходимо скачать 258 kБ архивов.
После данной операции, объём занятого дискового пространства возрастёт на 2 616 kB.
...
Получено:2 http://ftp.ua.debian.org/debian/ wheezy/main file amd64 5.11-2+deb7u8 [53,4 kB]
Получено 258 kБ за 0с (572 kБ/c)
Выбор ранее не выбранного пакета libmagic1:amd64.
(Чтение базы данных … на данный момент установлено 30053 файла и каталога.)
Распаковывается пакет libmagic1:amd64 (из файла …/libmagic1_5.11-2+deb7u8_amd64.deb) …
Выбор ранее не выбранного пакета file.
Распаковывается пакет file (из файла …/file_5.11-2+deb7u8_amd64.deb) …
Обрабатываются триггеры для man-db …
Настраивается пакет libmagic1:amd64 (5.11-2+deb7u8) …
Настраивается пакет file (5.11-2+deb7u8) …
16:21:58
#file all
all: UTF-8 Unicode text
16:22:32
#find / -user ivan
/tmp/users
/var/mail/ivan
/dev/pts/2
/home/ivan
/home/ivan/.bashrc
/home/ivan/.bash_history
/home/ivan/d4
/home/ivan/d4/d3
/home/ivan/d4/d3/d1
/home/ivan/d4/d3/d1/f1
...
/proc/8537/oom_adj
/proc/8537/oom_score_adj
/proc/8537/loginuid
/proc/8537/sessionid
/proc/8537/coredump_filter
/proc/8537/io
find: `/proc/12582/task/12582/fd/5': Нет такого файла или каталога
find: `/proc/12582/task/12582/fdinfo/5': Нет такого файла или каталога
find: `/proc/12582/fd/5': Нет такого файла или каталога
find: `/proc/12582/fdinfo/5': Нет такого файла или каталога
16:24:00
#find / -user ivan |grep -v proc
/tmp/users
/var/mail/ivan
/dev/pts/2
/home/ivan
/home/ivan/.bashrc
/home/ivan/.bash_history
/home/ivan/d4
/home/ivan/d4/d3
/home/ivan/d4/d3/d1
/home/ivan/d4/d3/d1/f1
/home/ivan/d4/d3/d1/users
/home/ivan/.profile
/home/ivan/.viminfo
/home/ivan/.bash_logout
find: `/proc/12590/task/12590/fd/5': Нет такого файла или каталога
find: `/proc/12590/task/12590/fdinfo/5': Нет такого файла или каталога
find: `/proc/12590/fd/5': Нет такого файла или каталога
find: `/proc/12590/fdinfo/5': Нет такого файла или каталога
16:24:23
#find / -user ivan -type f 2> /dev/null|grep -v proc
/tmp/users
/var/mail/ivan
/home/ivan/.bashrc
/home/ivan/.bash_history
/home/ivan/d4/d3/d1/f1
/home/ivan/d4/d3/d1/users
/home/ivan/.profile
/home/ivan/.viminfo
/home/ivan/.bash_logout
16:25:03
#find / -user ivan -type f -empty2> /dev/null|grep -v proc
find: unknown predicate `-empty2'
16:25:28
#find / -user ivan -type f -empty 2> /dev/null|grep -v proc
/home/ivan/d4/d3/d1/f1
16:25:34
#find / -user ivan -type f -empty 2> /dev/null exec rm -f {} \;

16:28:14
#find / -user ivan -type f -empty2> /dev/null|grep -v proc
find: unknown predicate `-empty2'
16:28:19
#find / -user ivan |grep -v proc
/tmp/users
/var/mail/ivan
/dev/pts/2
/home/ivan
/home/ivan/.bashrc
/home/ivan/.bash_history
/home/ivan/d4
/home/ivan/d4/d3
/home/ivan/d4/d3/d1
/home/ivan/d4/d3/d1/f1
/home/ivan/d4/d3/d1/users
/home/ivan/.profile
/home/ivan/.viminfo
/home/ivan/.bash_logout
find: `/proc/12652/task/12652/fd/5': Нет такого файла или каталога
find: `/proc/12652/task/12652/fdinfo/5': Нет такого файла или каталога
find: `/proc/12652/fd/5': Нет такого файла или каталога
find: `/proc/12652/fdinfo/5': Нет такого файла или каталога

Среда (09/30/15)

/dev/pts/0
08:58:47
#cat.john/john.pot
l3script: cat.john/john.pot: Нет такого файла или каталога
прошло 11 минут
09:10:28
#cat .john/john.pot
$6$s2MItv3w$DaqUWGuX0hhkoyyrjsk4AaNTBqaoNtEXhSv5Kb1eweFwhXz7D904ClisTP8QyMGlxNO0BqgRhAxg6ISCj/Yd40:123
$6$CkJHVC8E$ykTJUix/7qmcPBJgqnJtCHlWhYfEaImqXcQyeRrwYm6Xi4KaZSfb4FB20ocZ/VlrQzTR2wiEobMxT/OM/FXgd0:password
$6$Yc4IPhJI$k9TKWvNdctkI3RVwsO17bIG0BSTPipKfvUsiII/8UAwcd8kfVuQpa7DGE68DvGKy2.aJWWRxcgElPMGxs8pkt0:123

Файлы

  • .john/john.pot
  • /etc/passwd
  • install
  • .john/john.pot
    >
    $6$s2MItv3w$DaqUWGuX0hhkoyyrjsk4AaNTBqaoNtEXhSv5Kb1eweFwhXz7D904ClisTP8QyMGlxNO0BqgRhAxg6ISCj/Yd40:123
    $6$CkJHVC8E$ykTJUix/7qmcPBJgqnJtCHlWhYfEaImqXcQyeRrwYm6Xi4KaZSfb4FB20ocZ/VlrQzTR2wiEobMxT/OM/FXgd0:password
    $6$Yc4IPhJI$k9TKWvNdctkI3RVwsO17bIG0BSTPipKfvUsiII/8UAwcd8kfVuQpa7DGE68DvGKy2.aJWWRxcgElPMGxs8pkt0:123
    
    /etc/passwd
    >
    root:x:0:0:root:/root:/bin/bash
    daemon:x:1:1:daemon:/usr/sbin:/bin/sh
    bin:x:2:2:bin:/bin:/bin/sh
    sys:x:3:3:sys:/dev:/bin/sh
    sync:x:4:65534:sync:/bin:/bin/sync
    games:x:5:60:games:/usr/games:/bin/sh
    man:x:6:12:man:/var/cache/man:/bin/sh
    lp:x:7:7:lp:/var/spool/lpd:/bin/sh
    mail:x:8:8:mail:/var/mail:/bin/sh
    news:x:9:9:news:/var/spool/news:/bin/sh
    uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
    proxy:x:13:13:proxy:/bin:/bin/sh
    www-data:x:33:33:www-data:/var/www:/bin/sh
    backup:x:34:34:backup:/var/backups:/bin/sh
    list:x:38:38:Mailing List Manager:/var/list:/bin/sh
    irc:x:39:39:ircd:/var/run/ircd:/bin/sh
    gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
    nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
    libuuid:x:100:101::/var/lib/libuuid:/bin/sh
    Debian-exim:x:101:103::/var/spool/exim4:/bin/false
    user:x:1000:1000:user,,,:/home/user:/bin/bash
    sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
    ivan:x:1001:1001::/home/ivan:/bin/bash
    petr:x:1002:1002::/home/petr:/bin/bash
    
    install
    >
    #!/bin/sh
    hostname=`hostname`
    uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
    ###############################################################################
    #
    # Set this variables before installation:
    lilalo_user=13-10-2014
    lab=NT-LNet
    install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
    lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
    #
    ###############################################################################
    lilalo_rc=.l3rc
    lilalo_home=.lilalo
    url_lilalo="http://xgu.ru/lilalo"
    url_l3bashrc="${url_lilalo}"/l3bashrc
    url_l3agent="${url_lilalo}"/l3-agent
    url_l3config_pm="${url_lilalo}"/l3config.pm
    url_l3config="${url_lilalo}"/l3-config
    url_l3prompt="${url_lilalo}"/l3prompt
    url_perl_modules=${url_lilalo}/
    perl_modules="Term-VT102 Text-Iconv"
    apt_get_install_this="perl make libmodule-build-perl libc6-dev gcc"
    wget=wget
    uname -a | egrep -qi '(bsd|darwin)' && wget=fetch
    normC='\033[0;39m'
    whiteC='\033[1;37m'
    redC='\033[0;31m'
    greenC='\033[0;32m'
    apt_get_install_deps()
    {
        return 0
        if which apt-get >& /dev/null
        then
            apt-get install -y $apt_get_install_this
        else
            echo "Please install this dependencies manually:"
            echo $apt_get_install_this
            echo "Have you installed this already (y/n)?"
            echo y | read answer
            if echo $answer | grep -q ^[yY]
            then
                true
            else
                echo Please install the dependencies and rerun the script
                exit 1
            fi
        fi
    }
    step()
    {
        msg="$1"
        shift
        printf "${whiteC}""$msg""...${normC}\n"
    #    eval "$@" 2>&1 | sed 's/^/|\ \ \ /' && printf "Ok\n" || printf "Failed\n"
        eval "$@" 2>&1 > log 2>&1 && \
        {
              cat log | sed 's/^/|\ \ \ /'
              printf "${greenC}""Ok\n""${normC}"
        } || \
        {
            cat log | sed 's/^/|\ \ \ /'
            printf "${redC}""Failed\n""${normC}"
        }
    }
    get_user_home()
    {
        uname -a | egrep -qi '(freebsd|darwin)' && pw user show "$@"| awk -F: '{print $9}' || getent passwd "$@"| awk -F: '{print $6}'
    }
    install_to_users_homes()
    {
        . l3bashrc
        users="$@"
        set -x
        for user in $users
        do
            user_home=`get_user_home "$user"`
            mkdir -p ${user_home}/${lilalo_home}
            mkdir /etc/lilalo/
            cp l3config.pm /etc/lilalo/
            cp l3-agent /usr/local/bin
            cp l3-config /usr/local/bin
            ln -s `which bash` /usr/local/bin/l3script
            chmod 755 /usr/local/bin/l3-{agent,config}
            cp l3bashrc ${user_home}/${lilalo_home}
            cp l3prompt ${user_home}/${lilalo_home}
            chmod 755 ${user_home}/${lilalo_home}/l3prompt
            chown -R $user ${user_home}/${lilalo_home}
            echo l3cd=${lilalo_context}/$user > ${user_home}/${lilalo_rc}
            chown -R $user ${user_home}/${lilalo_rc}
        done
        set +x
    }
    install_to_users_bashrc()
    {
        users="$@"
        for user in $users
        do
            user_home=`get_user_home "$user"`
            grep -q lilalo ${user_home}/.bashrc 2> /dev/null\
            || echo "[ \$0 == l3script ] && . ${user_home}/.lilalo/l3bashrc && _l3_start" >> ${user_home}/.bashrc; chown -R ${user} ${user_home}/.bashrc
        done
    }
    install_to_users_bash_profile()
    {
        users="$@"
        for user in $users
        do
            user_home=`get_user_home "$user"`
            grep -q l3-agent ${user_home}/.bash_profile 2> /dev/null \
            || { echo >> ${user_home}/.bash_profile ; cat ${user_home}/.bash_profile | sed '1s/^/l3-agentX/' | tr X '\n' > /tmp/$$$$l3 ; mv /tmp/$$$$l3 ${user_home}/.bash_profile; chown -R ${user} ${user_home}/.bash_profile; }
        done
    }
    show_usage()
    {
        cat <<USAGE
    Usage:
        $0
    USAGE
    }
    show_final_message()
    {
        cat <<FINAL_MESSAGE
    Installation is successfully completed.
    Now restart your shell or relogin
    to start script writing.
    Your current lilalo context is ${lilalo_context}/USER
    If you use xgu.ru backend, your labs will be available at
    http://xgu.ru/l3/${lilalo_context}
    Use commands
     $ l3cd ${lilalo_context%/*/*}/MY-NEW-CONTEXT/${hostname}/USER
     $ l3pwd
    to change and to know your current context.
    For further information see http://xgu.ru/lilalo/ (in Russian).
    Thank you gor using LiLaLo.
    Happy Labbing!
    (don't forget to restart bash or relogin)
    FINAL_MESSAGE
    }
    temp_dir=/tmp/lilalo-install-temp-$$
    mkdir -p ${temp_dir}
    cd ${temp_dir}
    step "Installing dependencies" apt_get_install_deps
    step "Downloading l3bashrc" ${wget} ${url_l3bashrc}
    step "Downloading l3prompt" ${wget} ${url_l3prompt}
    step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
    step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
    step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
    step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
    step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
    step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
    cd /
    rm -rf ${temp_dir}
    show_final_message
    

    Статистика

    Время первой команды журнала13:24:50 2015- 9-29
    Время последней команды журнала09:10:28 2015- 9-30
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, %26.73
    Процент синтаксически неверно набранных команд, % 1.98
    Суммарное время работы с терминалом *, час 2.46
    Количество командных строк в единицу времени, команда/мин 0.68
    Частота использования команд
    cat47|========================| 24.23%
    tr19|=========| 9.79%
    egrep16|========| 8.25%
    sed16|========| 8.25%
    grep11|=====| 5.67%
    find10|=====| 5.15%
    null7|===| 3.61%
    sort6|===| 3.09%
    awk6|===| 3.09%
    locate5|==| 2.58%
    vi5|==| 2.58%
    ls4|==| 2.06%
    ps4|==| 2.06%
    bash4|==| 2.06%
    [0-9]{2}3|=| 1.55%
    1[0-9]{2}3|=| 1.55%
    25[0-5])\.){3}([0-9]3|=| 1.55%
    25[0-5])'3|=| 1.55%
    2[0-4][0-9]3|=| 1.55%
    }'3|=| 1.55%
    uniq2|=| 1.03%
    apt-get2|=| 1.03%
    file2|=| 1.03%
    chmod1|| 0.52%
    ~1|| 0.52%
    john.pot1|| 0.52%
    /etc/cron.daily/locate1|| 0.52%
    ogo2.jpg1|| 0.52%
    shell.sh1|| 0.52%
    >1|| 0.52%
    install1|| 0.52%
    less1|| 0.52%
    du1|| 0.52%
    ____
    *) Интервалы неактивности длительностью 30 минут и более не учитываются

    Справка

    Для того чтобы использовать LiLaLo, не нужно знать ничего особенного: всё происходит само собой. Однако, чтобы ведение и последующее использование журналов было как можно более эффективным, желательно иметь в виду следующее:
    1. В журнал автоматически попадают все команды, данные в любом терминале системы.

    2. Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.

    3. Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
      $ l s-l
      bash: l: command not found
      

    4. Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
      $ test 5 -lt 4
      Обратите внимание на то, что код завершения команды может быть отличен от нуля не только в тех случаях, когда команда была выполнена с ошибкой. Многие команды используют код завершения, например, для того чтобы показать результаты проверки

    5. Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
      $ find / -name abc
      find: /home/devi-orig/.gnome2: Keine Berechtigung
      find: /home/devi-orig/.gnome2_private: Keine Berechtigung
      find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung
      find: /home/devi-orig/.metacity: Keine Berechtigung
      find: /home/devi-orig/.inkscape: Keine Berechtigung
      ^C
      

    6. Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
      # id
      uid=0(root) gid=0(root) Gruppen=0(root)
      

    7. Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
      $ vi ~/.bashrc
      2a3,5
      >    if [ -f /usr/local/etc/bash_completion ]; then
      >         . /usr/local/etc/bash_completion
      >        fi
      

    8. Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
      $ patch ~/.bashrc
      В данном случае изменения применяются к файлу ~/.bashrc

    9. Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.

      Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.

    10. Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.

    11. Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора

    12. Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.

    13. Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.

    14. Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:

      $ whoami
      
      user
      
      $ #^ Интересно, кто я?
      
      в журнале это будет выглядеть так:
      $ whoami
      
      user
      
      Интересно, кто я?

    15. Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:

      $ whoami
      
      user
      
      $ cat > /dev/null #^ Интересно, кто я?
      
      Программа whoami выводит имя пользователя, под которым 
      мы зарегистрировались в системе.
      -
      Она не может ответить на вопрос о нашем назначении 
      в этом мире.
      
      В журнале это будет выглядеть так:
      $ whoami
      user
      
      Интересно, кто я?
      Программа whoami выводит имя пользователя, под которым
      мы зарегистрировались в системе.

      Она не может ответить на вопрос о нашем назначении
      в этом мире.
      Для разделения нескольких абзацев между собой используйте символ "-", один в строке.

    16. Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=

    17. Содержимое файла может быть показано в журнале. Для этого его нужно вывести с помощью программы cat. Если вывод команды отметить симоволами #!, содержимое файла будет показано в журнале в специально отведённой для этого секции.
    18. Для того чтобы вставить скриншот интересующего вас окна в журнал, нужно воспользоваться командой l3shot. После того как команда вызвана, нужно с помощью мыши выбрать окно, которое должно быть в журнале.
    19. Команды в журнале расположены в хронологическом порядке. Если две команды давались одна за другой, но на разных терминалах, в журнале они будут рядом, даже если они не имеют друг к другу никакого отношения.
      1
          2
      3   
          4
      
      Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.

    О программе

    LiLaLo (L3) расшифровывается как Live Lab Log.
    Программа разработана для повышения эффективности обучения Unix/Linux-системам.
    (c) Игорь Чубин, 2004-2008

    $Id$