{"id":160579,"date":"2012-11-28T15:09:04","date_gmt":"2012-11-28T11:09:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=160579"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=160579","title":{"rendered":"<span class=\"post_title\">\u0426\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 Ubuntu<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442,<\/p>\n<p>  \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438 \u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0438\u043b\u0438 \u043d\u0435 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u043e\u0434 \u043d\u0430\u0448\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f? \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443.<\/p>\n<h6>\u0423\u0441\u043b\u043e\u0432\u0438\u0435:<\/h6>\n<p>  <\/p>\n<ul>\n<li>~ 50 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u0439, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u043d\u0430 Ubuntu Desktop (10.04-12.10).<\/li>\n<\/ul>\n<p>  <\/p>\n<h6>\u0417\u0430\u0434\u0430\u0447\u0430:<\/h6>\n<p>  <\/p>\n<ol>\n<li>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u044f\u0445.<\/li>\n<li>\u041b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0439 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/li>\n<li>\u0423\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439\/\u0432\u0441\u0435\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u0439.<\/li>\n<\/ol>\n<p>  <\/p>\n<h6>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f:<\/h6>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/www.canonical.com\/enterprise-services\/ubuntu-advantage\/landscape\">Landscape<\/a> \u2013 \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043d\u043e \u043f\u043b\u0430\u0442\u043d\u043e.<\/li>\n<li><a href=\"http:\/\/spacewalk.redhat.com\">Spacewalk<\/a> \u2013 \u0422\u043e\u043b\u044c\u043a\u043e RHEL \u0438 \u0435\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435.<\/li>\n<li>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u2013 \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u0434\u043b\u044f \u043d\u0430\u0441.<\/li>\n<\/ul>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u043e\u0438 \u0437\u043d\u0430\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2013 bash, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043d\u0435\u043c.<a name=\"habracut\"><\/a><br \/>  <i>\u0427\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f:<\/i>  <\/p>\n<ul>\n<li>ssh-server \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u044f\u0445.<\/li>\n<li>\u041e\u0431\u0449\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/li>\n<li>Linux \u0441\u0435\u0440\u0432\u0435\u0440 (\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 expect \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430).<\/li>\n<li>\u0421\u0435\u0442\u0435\u0432\u0430\u044f \u0448\u0430\u0440\u0430 (\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b nfs).<\/li>\n<\/ul>\n<p>  <i>\u041a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c:<\/i><br \/>  ssh adm@IP -&gt; \u0441\u0431\u043e\u0440 \u043d\u0443\u0436\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 -&gt; \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043b\u043e\u0433 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 -&gt; exit.<\/p>\n<p>  <i>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435:<\/i><br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/303\/dac\/b3c\/303dacb3c64e1e987a3a17cf260c1514.png\"\/><br \/>  \u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f. \u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u044e. <s>P.s \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0438 IP \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u044b \u0432 \u0446\u0435\u043b\u044f\u0445 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0441\u0442\u0438<\/s>. \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/807\/b3c\/ac9\/807b3cac9e2a177b2d14d4cf19a5ec27.png\"\/><br \/>  \u041a\u0440\u0430\u0442\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<br \/>  \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043b\u043e\u0433 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"https:\/\/dl.dropbox.com\/u\/99668196\/logs.zip\">\u0442\u0443\u0442<\/a><\/p>\n<p>  <i>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:<\/i><br \/>  \/root\/uuman \u2013 \u043a\u043e\u0440\u043d\u0435\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<br \/>  ..\/uuman\/log \u2013 \u043f\u0430\u043f\u043a\u0430 \u0441 \u043b\u043e\u0433 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 (\u043e\u043d\u0430 \u0436\u0435 \u0441\u0435\u0442\u0435\u0432\u0430\u044f \u0448\u0430\u0440\u0430).<br \/>  ..\/..\/log\/.menu_log \u2013 \u0441\u043a\u0440\u044b\u0442\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u0441 \u043a\u0440\u0430\u0442\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">setup \u2013 \u0444\u0430\u0439\u043b \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d.<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">#!\/usr\/bin\/expect -f  set IP $argv #\u041e\u0436\u0434\u0438\u0430\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 set timeout -1 spawn ssh adm@$IP #\u041e\u0436\u0434\u0438\u0434\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 expect -re &quot;(yes\/no)&quot; #\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c YES send &quot;yes\\r&quot; #\u041e\u0436\u0438\u0434\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u0430\u0440\u043e\u043b\u044c expect -re &quot;:&quot; send &quot;YOU_PASSWORD\\r&quot; expect -re &quot;\\\\$ $&quot; #\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c sudo \u043f\u0430\u0440\u043e\u043b\u044c send &quot;sudo -K\\r&quot; expect -re &quot;\\\\$ $&quot; #\u0421\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f root send &quot;sudo su\\r&quot; expect -re &quot;password for&quot; send &quot;YOU_SUDO_PASSWORD\\r&quot; expect -re &quot;# $&quot; #\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0435\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b(\u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 samba \u0448\u0430\u0440\u0443 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u043f\u0430\u043a\u0435\u0442 nfs-common \u043d\u0430 cifs-utils) send &quot;apt-get install -y apt-show-versions nfs-common\\r&quot; expect -re &quot;# $&quot; send &quot;exit\\r&quot; expect -re &quot;\\\\$ $&quot; exit 0 <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">update \u2013 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445.<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">#!\/usr\/bin\/expect -f  set IP [lrange $argv 0 0] set USERN [lrange $argv 1 1] set DATES [exec date &quot;+%Y.%m.%d\/%H:%M:%S&quot;] #\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043f\u043e ssh (adm \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f) spawn ssh adm@$IP #\u0416\u0434\u0435\u043c \u043e\u0442\u0432\u0435\u0442 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 expect -re &quot;Password:&quot; #\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c send &quot;YOU_PASSWORD\\r&quot; #\u0416\u0434\u0435\u043c \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0440\u043e\u043a\u0438 $ expect -re &quot;\\\\$ $&quot; #\u0422\u0440\u0435\u0431\u0443\u0435\u043c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 sudo send &quot;sudo -K\\r&quot; expect -re &quot;\\\\$ $&quot; #\u0421\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f root send &quot;sudo su\\r&quot; expect -re &quot;password for&quot; send &quot;YOU_SUDO_PASSWORD\\r&quot; #\u0416\u0434\u0435\u043c \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0440\u043e\u043a\u0438 # expect -re &quot;# $&quot; #\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443, \u0434\u043b\u044f \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u0430\u0440\u044b send &quot;mkdir -m 777 \/tmp\/share &gt; \/dev\/null 2&gt;&1\\r&quot; expect -re &quot;# $&quot; #\u041c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c nfs \u0448\u0430\u0440\u0443 (\u0434\u043b\u044f samba \u0441\u0442\u0440\u043e\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442\u044c \u0438\u043d\u0430\u0447\u0435) send &quot;mount.nfs 192.168.0.1:\/root\/uuman\/log \/tmp\/share\\r&quot; expect -re &quot;# $&quot; #\u0414\u0430\u0442\u0430 \u0432 \u043b\u043e\u0433 \u0444\u0430\u0439\u043b send &quot;date &gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; #\u0412\u0435\u0440\u0441\u0438\u044f \u044f\u0434\u0440\u0430, \u0431\u0438\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u043b\u043e\u0433 \u0444\u0430\u0439\u043b send &quot;uname -a &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; #\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0442\u0430\u0435\u043b\u044f \u0432 \u043b\u043e\u0433 send &quot;echo Username:$USERN &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; #IP \u0432 \u043b\u043e\u0433 send &quot;echo IP:$IP &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; #\u0418\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0432 \u043b\u043e\u0433 send &quot;(echo -n Hostname:;hostname) &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; #\u0412\u0435\u0440\u0441\u0438\u044f Ubuntu \u0432 \u043b\u043e\u0433 send &quot;(cat \/etc\/issue.net) &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; #\u0421\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0442\u0441\u0432\u043e \u0434\u043e\u0441\u0442\u043f\u0443\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043b\u043e\u0433 \u0444\u0430\u0439\u043b send &quot;(echo -n Count of packages for update:;apt-show-versions -u | wc -l) &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; #\u041f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 send &quot;echo &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; #\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043b\u043e\u0433 send &quot;apt-show-versions -u | column -t &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; #\u0421\u0442\u0440\u043e\u043a\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u0435\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0435\u043d\u044e (\u0418\u041c\u042f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f | IP | ubuntu_version | \u043a\u043e\u043b-\u0432\u043e \u043f\u0430\u043a\u0435\u0442\u043e\u0432 | \u0434\u0430\u0442\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430) send &quot;(echo -n $USERN;echo -n ' |' $IP '| ';cat \/etc\/issue.net | sed 's\/ \/_\/g';echo -n AvailableUpdates\\:;apt-show-versions -u | wc -l ;echo -n $DATES) &gt; \/tmp\/share\/.menu_log\/$IP.log\\r&quot; expect -re &quot;# $&quot; #\u041e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0448\u0430\u0440\u0443 send &quot;umount -f \/tmp\/share\\r&quot; expect -re &quot;# $&quot; #\u041e\u0447\u0438\u0449\u0430\u0435\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u044e root send &quot;history -c\\r&quot; expect -re &quot;# $&quot; #\u0432\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 root send &quot;exit\\r&quot; expect -re &quot;\\\\$ $&quot; exit 0 <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">package \u2013 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u043c\u0430\u0448\u0438\u043d.<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">#!\/usr\/bin\/expect -f  set IP [lrange $argv 0 0] set USERN [lrange $argv 1 1] set DATES [exec date &quot;+%Y.%m.%d\/%H:%M:%S&quot;] #\u0416\u0434\u0435\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b set timeout -1 spawn ssh adm@$IP expect -re &quot;Password:&quot; send &quot;YOU_PASSWORD\\r&quot; expect -re &quot;\\\\$ $&quot; send &quot;sudo -K\\r&quot; expect -re &quot;\\\\$ $&quot; send &quot;sudo su\\r&quot; expect -re &quot;password for&quot; send &quot;YOU_SUDO_PASSWORD\\r&quot; expect -re &quot;# $&quot; #\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 send &quot;apt-get -y upgrade\\r&quot; expect -re &quot;# $&quot; #\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u043b\u043e\u0433 send &quot;mkdir -m 777 \/tmp\/share &gt; \/dev\/null 2&gt;&1\\r&quot; expect -re &quot;# $&quot; send &quot;mount.nfs 192.168.0.1:\/root\/uuman\/log \/tmp\/share\\r&quot; expect -re &quot;# $&quot; send &quot;date &gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; send &quot;uname -a &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; send &quot;echo IP:$IP &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; send &quot;(echo -n Hostname:;hostname) &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; send &quot;(cat \/etc\/issue.net) &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; send &quot;(echo -n Count of packages for update:;apt-show-versions -u | wc -l) &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; send &quot;echo &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; send &quot;apt-show-versions -u | column -t &gt;&gt; \/tmp\/share\/$IP.log\\r&quot; expect -re &quot;# $&quot; send &quot;(echo -n $USERN;echo -n ' |' $IP '| ';cat \/etc\/issue.net | sed 's\/ \/_\/g';echo -n AvailableUpdates\\:;apt-show-versions -u | wc -l ;echo -n $DATES) &gt; \/tmp\/share\/.menu_log\/$IP.log\\r&quot; expect -re &quot;# $&quot; send &quot;umount \/tmp\/share\\r&quot; expect -re &quot;# $&quot; send &quot;apt-get -y upgrade\\r&quot; expect -re &quot;# $&quot; send &quot;history -c\\r&quot; expect -re &quot;# $&quot; send &quot;exit\\r&quot; expect -re &quot;\\\\$ $&quot; exit 0 <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">uuman.sh \u2013 \u0444\u0430\u0439\u043b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0430\u0439\u043b).<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">#!\/bin\/bash  #\u0414\u0430\u0442\u0430 \u0434\u043b\u044f \u043b\u043e\u0433\u043e\u0432 DATE=`date &quot;+%Y.%m.%d\/%H:%M:%S&quot;` #\u041f\u0430\u043f\u043a\u0430 \u043b\u043e\u0433 \u0444\u0430\u0439\u043b\u043e\u0432 LOCAL=&quot;\/root\/uuman\/log&quot; #\u0420\u0430\u0431\u043e\u0447\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 WORKD=&quot;\/root\/uuman&quot;  #[\\]\u0418\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0440\u0430\u0431\u043e\u0442\u044b spinner() {     local pid=$1     local delay=0.25     while [ $(ps -eo pid | grep $pid) ]; do         for i in \\| \/ - \\\\; do             printf ' [%c]\\b\\b\\b\\b' $i             sleep $delay         done     done     printf '\\b\\b\\b\\b' }  #\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0445\u043e\u0441\u0442\u0430\u0445 UPDATEA() {     #2012_11_23     DATEFN=`date &quot;+%Y_%m_%d&quot;`     #\u0417\u0430\u0434\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043b\u043e\u0433\u0430\u043c\u0438. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f nfs     chown -R nfsnobody:nfsnobody $LOCAL     i=0     #\u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0444\u0430\u0439\u043b\u0430     cat $WORKD\/ip.txt | while read line; do     USERN=`echo $line`     #\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c IP \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \tIP=`echo $line | grep -Eo '([0-9]{1,3}\\.){3}[0-9]{1,3}'`     #\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0445\u043e\u0441\u0442\u0430     if ping -c 1 -s 1 -W 1 $IP &gt; \/dev\/null 2&gt;&1; then \t     i=`expr $i + 1` \t     #\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 screen          screen -A -m -d -S &quot;upd$i&quot; expect $WORKD\/update $IP $USERN          #\u0421\u0442\u0440\u043e\u043a\u0430 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0445\u043e\u0441\u0442\u043e\u0432 \t     #screen -A -m -d -S &quot;upd$i&quot; expect $WORKD\/setup $IP     else \t     #\u0415\u0441\u043b\u0438 \u0445\u043e\u0441\u0442 \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u0438\u0448\u0435\u043c \u0432 \u043b\u043e\u0433\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0432\u043e\u0434          #\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u0433 \u043e\u0448\u0438\u0431\u043e\u043a \t     echo &quot;$DATE&quot; &gt;&gt; $LOCAL\/err.txt          echo &quot;$USERN - not connected&quot; &gt;&gt; $LOCAL\/err.txt \t     echo &gt;&gt; $LOCAL\/err.txt \t     #\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0431\u0449\u0438\u0439 \u043b\u043e\u0433 \t     echo &quot;$DATE | $USERN - not connected&quot; &gt;&gt; $LOCAL\/upd.txt \t     echo &gt;&gt; $LOCAL\/upd.txt \t     #\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u0433 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0430\u0442\u044b \t     echo &quot;$DATE | $USERN - not connected&quot; &gt;&gt; $LOCAL\/UPD-$DATEFN.txt \t     echo &gt;&gt; $LOCAL\/UPD-$DATEFN.txt \t     #\u0415\u0441\u043b\u0438 \u0445\u043e\u0441\u0442 \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u0431\u044b\u043b \u0432 \u0441\u0435\u0442\u0438, \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 not connected \u0432 \u043c\u0435\u043d\u044e \t     NT=`cat $LOCAL\/.menu_log\/$IP.log | grep &quot;AvailableUpdates&quot;` \t     if [ -z &quot;$NT&quot; ]; then \t          echo -n &quot;$USERN | Unknown | NotConnected | $DATE&quot; &gt; $LOCAL\/.menu_log\/$IP.log \t     fi     fi     done     #\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u0445\u043e\u0441\u0442\u0430\u043c \u0432 \u043e\u0431\u0449\u0438\u0439 \u043b\u043e\u0433     ls $LOCAL | grep .log | while read TXT; do          paste $LOCAL\/$TXT &gt;&gt; $LOCAL\/upd.txt          echo &gt;&gt; $LOCAL\/upd.txt \t     #\u0412 \u043b\u043e\u0433 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0434\u0430\u0442\u0443 \t     paste $LOCAL\/$TXT &gt;&gt; $LOCAL\/UPD-$DATEFN.txt \t     echo &gt;&gt; $LOCAL\/UPD-$DATEFN.txt     done }  #\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0445\u043e\u0441\u0442\u043e\u0432 PACKAGEA() {     #2012_11_23     DATEFN=`date &quot;+%Y_%m_%d&quot;`     #\u0417\u0430\u0434\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043b\u043e\u0433\u0430\u043c\u0438. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f nfs     chown -R nfsnobody:nfsnobody $LOCAL     i=0     #\u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0444\u0430\u0439\u043b\u0430     cat $WORKD\/ip.txt | while read line; do     USERN=`echo $line`     #\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c IP \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438     IP=`echo $line | grep -Eo '([0-9]{1,3}\\.){3}[0-9]{1,3}'`     #\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0445\u043e\u0441\u0442\u0430     if ping -c 1 -s 1 -W 1 $IP &gt; \/dev\/null 2&gt;&1; then          i=`expr $i + 1`          #\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 screen          screen -A -m -d -S &quot;upd$i&quot; expect $WORKD\/package $IP $USERN      else          #\u0415\u0441\u043b\u0438 \u0445\u043e\u0441\u0442 \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u0438\u0448\u0435\u043c \u0432 \u043b\u043e\u0433\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0432\u043e\u0434          #\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u0433 \u043e\u0448\u0438\u0431\u043e\u043a          echo &quot;$DATE&quot; &gt;&gt; $LOCAL\/err.txt          echo &quot;$USERN - not connected&quot; &gt;&gt; $LOCAL\/err.txt          echo &gt;&gt; $LOCAL\/err.txt          #\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0431\u0449\u0438\u0439 \u043b\u043e\u0433          echo &quot;$DATE | $USERN - not connected&quot; &gt;&gt; $LOCAL\/upd.txt          echo &gt;&gt; $LOCAL\/upd.txt          #\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u0433 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0430\u0442\u044b          echo &quot;$DATE | $USERN - not connected&quot; &gt;&gt; $LOCAL\/UPD-$DATEFN.txt          echo &gt;&gt; $LOCAL\/UPD-$DATEFN.txt          #\u0415\u0441\u043b\u0438 \u0445\u043e\u0441\u0442 \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u0431\u044b\u043b \u0432 \u0441\u0435\u0442\u0438, \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 not connected \u0432 \u043c\u0435\u043d\u044e          NT=`cat $LOCAL\/.menu_log\/$IP.log | grep &quot;AvailableUpdates&quot;`          if [ -z &quot;$NT&quot; ]; then               echo -n &quot;$USERN | Unknown | NotConnected | $DATE&quot; &gt; $LOCAL\/.menu_log\/$IP.log          fi     fi     done     #\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u0445\u043e\u0441\u0442\u0430\u043c \u0432 \u043e\u0431\u0449\u0438\u0439 \u043b\u043e\u0433     ls $LOCAL | grep .log | while read TXT; do          paste $LOCAL\/$TXT &gt;&gt; $LOCAL\/upd.txt          echo &gt;&gt; $LOCAL\/upd.txt          #\u0412 \u043b\u043e\u0433 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0434\u0430\u0442\u0443          paste $LOCAL\/$TXT &gt;&gt; $LOCAL\/UPD-$DATEFN.txt          echo &gt;&gt; $LOCAL\/UPD-$DATEFN.txt     done }  #\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u043c\u0438\u043d\u0438-\u043e\u0442\u0447\u0435\u0442\u0430 \u043f\u043e \u0445\u043e\u0441\u0442\u0430\u043c (\u041c\u0435\u043d\u044e) MAIN() {     rm -rf $LOCAL\/MENU.txt     ls $LOCAL\/.menu_log | grep .log | while read MENU; do \t     #\u0412\u0441\u0435 \u0434\u043b\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 (\u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0437\u0430\u043c\u0435\u043d\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432)\t          TEXT=`paste -s -d '|' $LOCAL\/.menu_log\/$MENU | sed 's\/|\/ | \/g;s\/-\/|\/g'` \t     echo $TEXT &gt;&gt; $LOCAL\/MENU.txt     done     #\u041e\u0447\u0438\u0441\u0442\u043a\u0430 \u044d\u043a\u0440\u0430\u043d\u0430 \u0438 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0444\u0430\u0439\u043b\u0430     clear && cat $LOCAL\/MENU.txt | column -t }  #\u041c\u0435\u043d\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 MENU()  {     echo     echo &quot;1.Get update-information for Ubuntu-host (by custom IP-address)&quot;     echo &quot;2.Get update-information for all Ubuntu-hosts (uses file with IP-addresses)&quot;     echo &quot;3.Update packages for Ubuntu-host (by custom IP-address)&quot;     echo &quot;4.Update packages for all hosts (uses file with IP-addresses)&quot;     echo &quot;5.View error-connection log&quot;     echo &quot;6.Refresh&quot;     echo &quot;7.Exit&quot;     read SELECT      case $SELECT in     1) \t     #\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c IP          echo -n &quot;Enter IP:&quot;          read IP          #\u0417\u0430\u0434\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043b\u043e\u0433\u0430\u043c\u0438. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f nfs     \t chown -R nfsnobody:nfsnobody $LOCAL \t     #\u0414\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043b\u0438 \u0445\u043e\u0441\u0442          if ping -c 1 -s 1 -W 1 $IP &gt; \/dev\/null 2&gt;&1; then \t          #\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0442\u0435\u043b\u044f \u043f\u043e IP \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0435\u0433\u043e \u0438\u043c\u044f \t          USERN=`cat $WORKD\/ip.txt | grep &quot;$IP&quot; | sed 's\/ .*\/\/'`               $WORKD\/update $IP $USERN &gt; \/dev\/null 2&gt;&1 & spinner $!               cat $LOCAL\/$IP.log \t     else \t          #\u0423\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0435\u043c \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043b\u043e\u0433 \u043e\u0448\u0438\u0431\u043e\u043a               echo &quot;Computer is not online&quot;               echo &quot;$DATE&quot; &gt;&gt; $LOCAL\/err.txt               echo &quot;$IP - not connected&quot; &gt;&gt; $LOCAL\/err.txt               echo &gt;&gt; $LOCAL\/err.txt          fi \t     MENU          ;;     2) \t     #\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0441\u0435\u0445 \u0445\u043e\u0441\u0442\u0430\u0445          UPDATEA &gt; \/dev\/null 2&gt;&1 & spinner $!          #\u041d\u0435 \u0432\u0441\u0435 \u0445\u043e\u0441\u0442\u044b \u0443\u0441\u043f\u0435\u0432\u0430\u044e\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u043a\u0430\u0437\u043e\u043c \u043c\u0435\u043d\u044e \t     #sleep 5s \t     MAIN \t     MENU \t     ;;     3) \t     #\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 IP          echo &quot;Enter IP:&quot;          read IP          #\u0417\u0430\u0434\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043b\u043e\u0433\u0430\u043c\u0438. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f nfs     \t chown -R nfsnobody:nfsnobody $LOCAL \t     if ping -c 1 -s 1 -W 1 $IP &gt; \/dev\/null 2&gt;&1; then \t          #\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0442\u0435\u043b\u044f \u043f\u043e IP \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0435\u0433\u043e \u0438\u043c\u044f               USERN=`cat $WORKD\/ip.txt | grep &quot;$IP&quot; | sed 's\/ .*\/\/'`               $WORKD\/package $IP $USERN &gt; \/dev\/null 2&gt;&1 & spinner $! \t          cat $LOCAL\/$IP.log \t     else \t          echo &quot;Computer is not online&quot; \t          echo &quot;$DATE&quot; &gt;&gt; $LOCAL\/err.txt               echo &quot;$IP - not connected&quot; &gt;&gt; $LOCAL\/err.txt               echo &gt;&gt; $LOCAL\/err.txt \t     fi \t     MENU          ;;     4) \t     #\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0445\u043e\u0441\u0442\u044b          PACKAGEA &gt; \/dev\/null 2&gt;&1 & spinner $!          #\u041d\u0435 \u0432\u0441\u0435 \u0445\u043e\u0441\u0442\u044b \u0443\u0441\u043f\u0435\u0432\u0430\u044e\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u043a\u0430\u0437\u043e\u043c \u043c\u0435\u043d\u044e \t     #sleep 5s \t     MAIN \t     MENU          ;;     5) \t     #\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043b\u043e\u0433 \u043e\u0448\u0438\u0431\u043e\u043a          cat $LOCAL\/err.txt \t     MENU          ;;     6) \t     #\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c          MAIN          MENU \t     ;;     7)          exit 0 \t     ;;     *) \t     MENU    esac }  #\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 #\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 ARG=$1    case $ARG in     #\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0441\u0435\u0445 \u0445\u043e\u0441\u0442\u0430\u0445     check)          UPDATEA          exit 0          ;;     #\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0445\u043e\u0441\u0442\u044b     update)          PACKAGEA          exit 0          ;;     *)          MAIN          MENU          ;;    esac <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ip.txt \u2013 \u0431\u0430\u0437\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f User \u2013 IP.<\/b><\/p>\n<div class=\"spoiler_text\">User1 \u2014 192.168.0.1<br \/>  User2 \u2014 192.168.0.2<br \/>  User3 \u2014 192.168.0.3<br \/>  User4 \u2014 192.168.0.4  <\/div>\n<\/div>\n<p>  <i>\u041a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f:<\/i><br \/>  \u0415\u0441\u043b\u0438 \u0412\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u0432\u043e\u0438 \u043f\u0443\u0442\u0438, \u043f\u043e\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 uuman.sh:  <\/p>\n<pre><code class=\"bash\">#\u041f\u0430\u043f\u043a\u0430 \u043b\u043e\u0433 \u0444\u0430\u0439\u043b\u043e\u0432 LOCAL=&quot;\/root\/uuman\/log&quot; #\u0420\u0430\u0431\u043e\u0447\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 WORKD=&quot;\/root\/uuman&quot; <\/code><\/pre>\n<p>  \u0421\u043a\u0440\u0438\u043f\u0442 setup \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u044f\u0445. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u0432 \u0444\u0430\u0439\u043b\u0435 uuman.sh \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443:  <\/p>\n<pre><code class=\"bash\">screen -A -m -d -S &quot;upd$i&quot; expect $WORKD\/update $IP $USERN <\/code><\/pre>\n<p>\u0418 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439\u0442\u0435:  <\/p>\n<pre><code class=\"bash\">#screen -A -m -d -S &quot;upd$i&quot; expect $WORKD\/setup $IP  <\/code><\/pre>\n<p>  \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0436\u0438\u043c:<br \/>  <code>$WORKD\/uuman.sh check<\/code> \u2014 \u0447\u0435\u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u0439 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 ip.txt \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439.<br \/>  <code>$WORKD\/uuman.sh update<\/code> \u2014 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u0439, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 ip.txt.<\/p>\n<h6>\u0418\u0442\u043e\u0433:<\/h6>\n<p>  \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0443\u044e \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0438\u043b\u0438 \u0440\u0443\u0447\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c, \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u044f\u0445 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Ubuntu Linux. \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/160579\/\"> http:\/\/habrahabr.ru\/post\/160579\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442,<\/p>\n<p>  \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438 \u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0438\u043b\u0438 \u043d\u0435 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u043e\u0434 \u043d\u0430\u0448\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f? \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443.<\/p>\n<h6>\u0423\u0441\u043b\u043e\u0432\u0438\u0435:<\/h6>\n<p>  <\/p>\n<ul>\n<li>~ 50 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u0439, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u043d\u0430 Ubuntu Desktop (10.04-12.10).<\/li>\n<\/ul>\n<p>  <\/p>\n<h6>\u0417\u0430\u0434\u0430\u0447\u0430:<\/h6>\n<p>  <\/p>\n<ol>\n<li>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u044f\u0445.<\/li>\n<li>\u041b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0439 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/li>\n<li>\u0423\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439\/\u0432\u0441\u0435\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u0439.<\/li>\n<\/ol>\n<p>  <\/p>\n<h6>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f:<\/h6>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/www.canonical.com\/enterprise-services\/ubuntu-advantage\/landscape\">Landscape<\/a> \u2013 \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043d\u043e \u043f\u043b\u0430\u0442\u043d\u043e.<\/li>\n<li><a href=\"http:\/\/spacewalk.redhat.com\">Spacewalk<\/a> \u2013 \u0422\u043e\u043b\u044c\u043a\u043e RHEL \u0438 \u0435\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435.<\/li>\n<li>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u2013 \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u0434\u043b\u044f \u043d\u0430\u0441.<\/li>\n<\/ul>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u043e\u0438 \u0437\u043d\u0430\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2013 bash, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043d\u0435\u043c.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-160579","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/160579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=160579"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/160579\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=160579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=160579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=160579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}