{"id":272507,"date":"2016-01-20T12:24:04","date_gmt":"2016-01-20T09:24:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=272507"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=272507","title":{"rendered":"\u0421\u0442\u043e\u0440\u043e\u0436\u0435\u0432\u043e\u0439 \u0442\u0430\u0439\u043c\u0435\u0440 \u0434\u043b\u044f 4G \u043c\u043e\u0434\u0435\u043c\u0430 \u0432 CentOS 7"},"content":{"rendered":"<p>       \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0435\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 <a href=\"http:\/\/habrahabr.ru\/post\/273547\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \/ \u0444\u0430\u0439\u043b-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0417\u0434\u0435\u0441\u044c \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e\u0431 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u043f\u0440\u0438 \u0437\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u0438 4G USB \u043c\u043e\u0434\u0435\u043c\u0430. \u041d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0434\u0435\u0438 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e, \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0441\u0432\u043e\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d7c\/477\/ed9\/d7c477ed972e4803959a0bb3108c53fd.png\"\/><br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0437 \u0432 \u043c\u0435\u0441\u044f\u0446, \u0441\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u0442\u0430\u043a, \u0447\u0442\u043e USB \u043c\u043e\u0434\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0430\u043b. \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u043e \u043c\u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430: \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0430 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440, \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u0437\u0430\u043a\u0430\u0447\u043a\u0443 \u0444\u0438\u043b\u044c\u043c\u044b. \u0423\u0434\u0430\u043b\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0440\u0435\u0448\u0438\u0442\u044c \u0431\u044b\u043b\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u043c\u043e\u0433\u0430\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0435\u043c\u0430 \u043f\u043e \u043f\u0438\u0442\u0430\u043d\u0438\u044e. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0443\u0437\u043b\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0438 \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043c.<\/p>\n<p>  \u0412 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u044f \u043d\u0430\u0448\u0435\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043d\u043e \u043d\u0435 \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 \u0443 \u043c\u0435\u043d\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u0436\u0435\u0432\u043e\u0439 \u0442\u0430\u0439\u043c\u0435\u0440 <a href=\"http:\/\/lurkmore.to\/%D0%91%D0%BB%D1%8D%D0%BA%D0%B4%D0%B6%D0%B5%D0%BA_%D0%B8_%D1%88%D0%BB%D1%8E%D1%85%D0%B8\">\u0441 \u043f\u0440\u0435\u0444\u0435\u0440\u0430\u043d\u0441\u043e\u043c \u0438 \u0431\u0430\u0440\u044b\u0448\u043d\u044f\u043c\u0438<\/a>. \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0431\u044b\u043b \u0432\u0437\u044f\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0437 <a href=\"https:\/\/www.linux.org.ru\/forum\/admin\/7985276\">\u044d\u0442\u043e\u0439<\/a> \u0442\u0435\u043c\u044b. \u041f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043e\u044f \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d \u043d\u043e\u0432\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043e\u043f\u0446\u0438\u0438. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 USB 4G \u043c\u043e\u0434\u0435\u043c\u0430 \u0432 CentOS 7.<\/b><\/p>\n<div class=\"spoiler_text\">\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b.  <\/p>\n<pre><code class=\"bash\">yum install usb_modeswitch usb_modeswitch-data <\/code><\/pre>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043c \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u043e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.  <\/p>\n<pre><code class=\"bash\">dmesg ip a <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 4G \u043c\u043e\u0434\u0435\u043c\u0430.  <\/p>\n<pre><code class=\"bash\">vim \/etc\/sysconfig\/network-scripts\/ifcfg-wwp6s0u1i1 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">DEVICE=&quot;wwp6s0u1i1&quot; NAME=&quot;wwp6s0u1i1&quot; TYPE=&quot;Ethernet&quot; ONBOOT=&quot;yes&quot; BOOTPROTO=&quot;dhcp&quot; HWADDR=&quot;XX:XX:XX:XX:XX:XX&quot; NM_CONTROLLED=&quot;no&quot; DNS1=127.0.0.1 DNS2=127.0.0.1 DNS3=127.0.0.1 NOZEROCONF=&quot;yes&quot; IPV4_FAILURE_FATAL=&quot;no&quot; IPV6INIT=&quot;no&quot; ZONE=&quot;external&quot; <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0438 \u0434\u0435 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0438\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.  <\/p>\n<pre><code class=\"bash\">vim \/sbin\/ifup-pre-local <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash # PREUP=&quot;\/etc\/sysconfig\/network-scripts\/pre-up-${1:6}&quot; if [ -x $PREUP ]; then exec $PREUP fi <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">vim \/sbin\/ifdown-pre-local <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash # PREDOWN=&quot;\/etc\/sysconfig\/network-scripts\/pre-down-$1&quot; if [ -x $PREDOWN ]; then exec $PREDOWN fi <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">vim \/etc\/sysconfig\/network-scripts\/pre-up-wwp6s0u1i1 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash # echo -en 'AT^NDISDUP=1,1,&quot;internet.yota&quot;\\r\\n' &gt; \/dev\/ttyUSB0 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">vim \/etc\/sysconfig\/network-scripts\/pre-down-wwp6s0u1i1 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash # echo -en 'AT^NDISDUP=1,0,&quot;internet.yota&quot;\\r\\n' &gt; \/dev\/ttyUSB0 <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c ttyUSB0 \u044d\u0442\u043e \u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0435\u043c\u0430.<\/p>\n<p>  \u041f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435.  <\/p>\n<pre><code class=\"bash\">ifup wwp6s0u1i1 ip a <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">#!\/bin\/bash  SN=&quot;$(basename &quot;$0&quot;)&quot;  function print_help() {     printf &quot;\\n&quot;     printf &quot;\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435: %s options...\\n&quot; &quot;$SN&quot;     printf &quot;\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:\\n&quot;     printf &quot;  -s         \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441.\\n&quot;     printf &quot;  -i         \u0418\u043c\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.\\n&quot;     printf &quot;  -d         \u0428\u0438\u043d\u0430 \u0438 \u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0435\u043c\u0430 lsusb -t.\\n&quot;     printf &quot;  -n         \u0427\u0438\u0441\u043b\u043e \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0445 \u043f\u0438\u043d\u0433\u043e\u0432.\\n&quot;     printf &quot;  -m         \u041c\u0430\u0440\u043a\u0435\u0440 \u043c\u043e\u0434\u0435\u043c\u0430, \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b lsusb.\\n&quot;     printf &quot;  -h         \u0421\u043f\u0440\u0430\u0432\u043a\u0430.\\n&quot;     printf &quot;\\n&quot; }  # \u0415\u0441\u043b\u0438 \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u0440\u0430\u0432\u043a\u0443. if [[ $# = 0 ]]; then     print_help && exit 1 fi while getopts &quot;:s:i:d:n:m:h&quot; opt ; do     case $opt in         s) SITE=$OPTARG;             ;;         i) IF=$OPTARG;             ;;         d) DEV=$OPTARG;             ;;         n) EP=$OPTARG;             ;;         m) MM=$OPTARG;             ;;         h) print_help             exit 1             ;;         *) printf &quot;\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\\n&quot;;            printf &quot;\u0414\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 %s -h\\n&quot; &quot;$SN&quot;;             exit 1             ;;         esac done  if [[ &quot;$SITE&quot; == &quot;&quot; ]] || [[ &quot;$IF&quot; == &quot;&quot; ]] || [[ &quot;$DEV&quot; == &quot;&quot; ]] || [[ &quot;$EP&quot; == &quot;&quot; ]] || [[ &quot;$MM&quot; == &quot;&quot; ]] ;  then  printf &quot;\\n&quot;  printf &quot;\u041e\u0434\u043d\u0430 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0446\u0438\u0439 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u044b.\\n&quot;  printf &quot;\u0414\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438 \u043d\u0430\u0431\u0435\u0440\u0438\u0442\u0435: %s -h\\n&quot; &quot;$SN&quot;  printf &quot;\\n&quot;  exit 1 fi  M=&quot;$(lsusb | grep -w &quot;$MM&quot;)&quot;  #\u0441\u0442\u0440\u043e\u043a\u0430 \u043c\u043e\u0434\u0435\u043c\u0430 \u0438\u0437 lsusb   if [[ &quot;$M&quot; != &quot;&quot; ]]; then   #\u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u043d, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u0438\u043d\u0433\u0438    if grep -w -q &quot;$IF&quot; \/proc\/net\/dev; then #\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430    printf &quot;\\n&quot;    printf &quot;\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 %s \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 %s\\n&quot; &quot;$SITE&quot; &quot;$IF&quot;    printf &quot;\\n&quot;     if [[ &quot;$EP&quot; -ge 6 ]]; then      printf &quot;\u0427\u0438\u0441\u043b\u043e \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0445 \u043f\u0438\u043d\u0433\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e 5\\n&quot;      exit 1     else      printf &quot;\u0414\u0435\u043b\u0430\u0435\u043c \u043f\u0438\u043d\u0433\u0438...\\n&quot;      flag=&quot;0&quot;      for i in {1..5}; do #\u0434\u0435\u043b\u0430\u0435\u043c 5 \u043f\u0438\u043d\u0433\u043e\u0432 \u0434\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430      timeout -k 2 -s TERM 16 ping -w 14 -s 8 -c 1 -I &quot;$IF&quot; &quot;$SITE&quot; || flag=$((flag+1)) && printf &quot;\u043f\u0438\u043d\u0433:%s\/5 (\u043e\u0448\u0438\u0431\u043e\u043a:%s)\\n&quot; &quot;$i&quot; &quot;$flag&quot; #\u043f\u0438\u043d\u0433 \u043d\u0435 \u043f\u0440\u043e\u0448\u0435\u043b - \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a       if ((&quot;$flag&quot; &gt;= &quot;$EP&quot;)); then        break       else        read -r -t 1 &gt; \/dev\/null       fi      done      printf &quot;\u043f\u043e\u0442\u0435\u0440\u044c \u043f\u0430\u043a\u0435\u0442\u043e\u0432: %s \u0438\u0437 %s\\n&quot; &quot;$flag&quot; &quot;$i&quot;      printf &quot;\\n&quot;       if ((&quot;$flag&quot; &gt;= &quot;$EP&quot;)); then #\u0435\u0441\u043b\u0438 \u043f\u043e\u0442\u0435\u0440\u044c \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 2\u0445       M=&quot;$(lsusb | grep &quot;$MM&quot;)&quot;   #\u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0441\u043d\u043e\u0432\u0430 \u0433\u043b\u044f\u043d\u0435\u043c - \u0432\u0434\u0440\u0443\u0433 \u043c\u043e\u0434\u0435\u043c \u0432\u044b\u0434\u0435\u0440\u043d\u0443\u043b\u0438       printf &quot;\u0411\u0443\u0434\u0435\u0442 \u0441\u0431\u0440\u043e\u0448\u0435\u043d \u043c\u043e\u0434\u0435\u043c:\\n&quot;       printf &quot;%s\\n&quot; &quot;$M&quot; | cut -c 34-       if ! [[ -d \/sys\/bus\/usb\/drivers\/usb\/&quot;$DEV&quot; ]]; then        printf &quot;\u041d\u0435\u0432\u0435\u0440\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u044b Bus \u0438 Port \u043c\u043e\u0434\u0435\u043c\u0430.\\n&quot;        exit 1       else       ifdown &quot;$IF&quot; #\u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441       printf &quot;%s&quot; &quot;$DEV&quot; &gt; &quot;\/sys\/bus\/usb\/drivers\/usb\/unbind&quot; && printf &quot;%s&quot; &quot;$DEV&quot; &gt; &quot;\/sys\/bus\/usb\/drivers\/usb\/bind&quot; #\u043f\u0435\u0440\u0435\u0437\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0435\u043c\u0430 #      read -r -t 1 &gt; \/dev\/null       ifup &quot;$IF&quot; #\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441       fi      fi     fi   else    printf &quot;\\n&quot;    printf &quot;\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 %s \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442\\n&quot; &quot;$IF&quot;    printf &quot;\\n&quot;    exit 1   fi else   printf &quot;\u041c\u043e\u0434\u0435\u043c %s \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d.\\n&quot; &quot;$MM&quot; fi <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043a\u0440\u0438\u043f\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432 \/usr\/local\/bin\/.<br \/>  \u0427\u0442\u043e\u0431\u044b \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0440\u0430\u0437 \u0432 \u043f\u044f\u0442\u044c \u043c\u0438\u043d\u0443\u0442, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 cron.  <\/p>\n<pre><code class=\"bash\">crontab -e <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">*\/5 * * * * \/usr\/local\/bin\/watchdog -m Huawei -s ya.ru -i wwp6s0u2i1 -n 3 -d 1-1 &gt; \/dev\/null 2&gt;&1 <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0432\u044b\u0432\u043e\u0434 dmesg, \u043d\u0430 \u043d\u0435\u043c \u0432\u0438\u0434\u0435\u043d \u0441\u0431\u0440\u043e\u0441 \u043c\u043e\u0434\u0435\u043c\u0430 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430.  <\/p>\n<pre><code class=\"bash\">[181709.595498] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0 [181709.595568] option 1-1:1.0: device disconnected [181709.595798] huawei_cdc_ncm 1-1:1.1 wwp6s0u2i1: unregister 'huawei_cdc_ncm' usb-0000:06:00.0-1, Huawei CDC NCM device [181709.615005] option 1-1:1.0: GSM modem (1-port) converter detected [181709.616597] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0 [181709.623449] usb 1-1: MAC-Address: 0c:5b:8f:27:9a:64 [181709.623958] huawei_cdc_ncm 1-1:1.1: cdc-wdm0: USB WDM device [181709.624341] huawei_cdc_ncm 1-1:1.1 wwan0: register 'huawei_cdc_ncm' at usb-0000:06:00.0-1, Huawei CDC NCM device, 0c:5b:8f:27:9a:64 <\/code><\/pre>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0436\u0443 \u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u043b\u0435\u043a \u043e\u0442 \u0438\u0434\u0435\u0430\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u043c\u0443 \u0441\u043e\u0432\u0435\u0442\u044b \u0438 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043a\u0440\u0438\u0442\u0438\u043a\u0443 \u0432 \u0441\u0432\u043e\u0439 \u0430\u0434\u0440\u0435\u0441. <br \/>  \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0447\u0443 \u043f\u043e\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 <a href=\"https:\/\/toster.ru\/\">Toster.ru<\/a> \u043f\u043e\u0434 \u043d\u0438\u043a\u043e\u043c <a href=\"https:\/\/toster.ru\/user\/AlekseyNemiro\">@AlekseyNemiro<\/a>, \u0437\u0430 \u043e\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u043f\u043e\u043c\u043e\u0449\u044c \u0432 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430.        \t<\/p>\n<div class=\"polling\">\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u0411\u0443\u0434\u0435\u0442 \u043b\u0438 \u0412\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442?<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"275551\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"14499\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv70989\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"70989\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv70989\">\u0414\u0430.<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv70991\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"70991\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv70991\">\u041d\u0435\u0442.<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"total\">\u041d\u0438\u043a\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"https:\/\/habrahabr.ru\/auth\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<\/p><\/div>\n<div class=\"clear\"><\/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\/275551\/\"> http:\/\/habrahabr.ru\/post\/275551\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0435\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 <a href=\"http:\/\/habrahabr.ru\/post\/273547\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \/ \u0444\u0430\u0439\u043b-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0417\u0434\u0435\u0441\u044c \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e\u0431 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u043f\u0440\u0438 \u0437\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u0438 4G USB \u043c\u043e\u0434\u0435\u043c\u0430. \u041d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0434\u0435\u0438 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e, \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0441\u0432\u043e\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d7c\/477\/ed9\/d7c477ed972e4803959a0bb3108c53fd.png\"\/>  <\/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-272507","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/272507","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=272507"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/272507\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=272507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=272507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=272507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}