Создание сайтов, поисковое продвижение, разработка веб-приложений.
+7 (917) 43-73-926
Email: feedback@goinweb.ru
ул. Новоженова 90/1, офис 419

Если у вас есть роутер ASUS или другой с прошивкой от Олега, то эта записка для вас. Недавно у меня возникла трудность, которую никак не получалось решить. VPN-сессия зависала, при этом VPN-соединение оставалось подключено. Роутер не мог понять, что надо переподключится.  Приходилось каждый раз вручную делать перезагрузку роутера, согласитесь, это долгий и утомительный процесс. 

linux-code

Я покопался в интернете, оказалось  я такой не один и проблема довольно масштабна среди “роутороводов”. Наши провайдеры не особо жалуют пользователей с роутерами, в большинстве случаев после ответа на вопрос “какая у вас операционная система” суппорт умолкает.

Я не задавался и продолжал искать,  но нигде не было универсального решения данной проблемы. Тогда я подумал, мой роутер основан на Unix и поддерживает Bash-скрипты.  Я решил написать “умный” скрипт перезагрузки, в случае повисания VPN-сессии. После нескольких проб и ошибок я остановился на таком варианте.

#!bin/sh

PINGRESORCE1="ya.ru"
PINGRESORCE2="google.com"

if (! ping -c 3 &{PINGRESORCE1} >/dev/nill 2>&1).
then

if (! ping -c 3 &{PINGRESORCE2} >/dev/nill 2>&1).
then
reboot

else
echo 'internet ok'
fi

else
echo 'internet ok'
fi

Алгоритм работы данного скрипта такой:  Сначала мы посылаем 3 ping’a до Яндекса, если они проходят то выводим “internet ok”. Если нет, то посылаем ещё 3 ping’a до Гугла, если проходят, выводи “internet ok”. Если ping не дойдёт  и до Гугла, то перезагрузка.

Этот скрипт необходимо добавить в планировщик задач (в большинстве случаев это cron), чтобы он выполнялся каждые 5-10 минут.

Качественные cайты на скриптах.

 

Старые комментарии:

Игорь 31.10.2010 18:37
Интересно, а как засунуть этот скрипт в роутер? :-?
 
Илья 31.10.2010 19:12
У меня DIR-320 с прошивкой от Олега.
По сути это уже полнофункционал ьный линукс, ;-) есть доступ к командной строке по SSH.
Советую посетить этот форум. (Ахтунг, там есть проблема с кодировкой нужно поставить Кириллицу Windows-1254)
http://wl500g.info/forumdisplay.php?f=86
 
Игорь 01.11.2010 13:48
Спасибо, получается, что роутер D-Link превращается в ASUS :eek:
 
Илья 01.11.2010 14:42
Ну.. Да :yehh2:
 
demeister 13.04.2011 04:26
скажите а на DD-WRT при прописании скрипта в cron он будет работать?
 
Илья 13.04.2011 15:15
Да должен, ибо тоже Linux :yehh2:
 
DarkShaman 21.05.2013 19:30
У меня на OpenWRT заработало так
#!/bin/sh
echo --------------- --------------- --------------- --
echo WAN CONTROLL RESTART
echo --------------- --------------- --------------- --
PINGRESORCE1="109.126.0.67"
PINGRESORCE2="109.126.1.67"
PINGRESORCE3="google.com"
if (! ping -q -c3 ${PINGRESORCE1} > /dev/null 2>&1)
then
if (! ping -q -c3 ${PINGRESORCE2} > /dev/null 2>&1)
then
if (! ping -q -c3 ${PINGRESORCE3} > /dev/null 2>&1)
then
reboot
else
echo 'internet ok'
fi
else
echo 'internet ok'
fi
else
echo 'internet ok'
fi
 
Паша 11.04.2014 21:35
У меня на OpenWRT. Не могу запустить скрипт. Объясните подробно в какую папку на роутере нужно скопировать файл скрипта, как создать этот файл и что нужно прописать в планировщике?
На данный момент создал файл /overlay/home/ping/ping.sh
в котором прописал все что в сообщении от #7 DarkShaman
Не работает. Где ошибка? Роутер не перезагружается при отключении сетевого кабеля ни сразу ни через 5 минут.
DarkShaman, подскажи как ты все проделал?
 
Олег 07.09.2014 17:27
Доброго времени суток! Скажите пожалуйста, а можно таким способом перезагружать другую точку, коротая подключена к моей мостом?

Комментарии  

#19001 Christoper 05.02.2023 01:11
%%

Also visit my web-site replacements Windows: http://eimall.web3.newwaynet.co.kr/bbs/board.php?bo_table=free&wr_id=213055
#19002 Joshua 05.02.2023 01:11
%%

my page :: Replacement
Windows Cost: https://211.110.178.122:443/bbs/board.php?bo_table=free&wr_id=1379653
#19003 Latia 05.02.2023 01:11
In addition to the games, you will get many bonuses throughout the
day.

Take a look at my web-site :: 우리카지노 샌즈 도메인: https://www.brandoodle.adityanamansingh.com/market/seven-questions-and-answers-to-2.html
#19004 Bernd 05.02.2023 01:12
Thanks for sharing your thoughts. I truly appreciate your efforts
and I will be waiting for your further write ups thank you
once again.

Feel free to surf to my webpage :: Puppies Topic: https://youtube.com/watch?v=z0J8tv3IWPw
#19005 Wilma 05.02.2023 01:13
Identification, a recent pay stub and bank account number are the only documents required.


My web page: 개인돈 대출: https://mylesgvuhp.blogsumer.com/19251284/how-사업자-대출-transformed-our-lives-in-the-newest-year
#19006 Carissa 05.02.2023 01:13
It’s just gotten crazy, it’s just gotten out off control, and for all the incorrect
causes.

Look into my webpage 먹튀검증사이트: https://emilianoyj319.yomoblog.com/21768032/the-newest-publicity-about-파워볼-베픽
#19007 Bryce 05.02.2023 01:14
You can authorize 1-time very same day payments, one particular-time future dated payments, and month-to-month automatic recurring payments.


Feeel free to surf too my blog post - 대출나라: https://socialmphl.com/story14973067/new-things-are-revealed-5-by-unbiased-article-about-%ED%94%84%EB%A6%AC%EB%9E%9C%EC%84%9C-%EB%8C%80%EC%B6%9C-that-no-one-is-talking-about
#19008 Deon 05.02.2023 01:14
%%

Look into my blog post: veterans disability Litigation: http://gemsgold.co.kr/bbs/board.php?bo_table=qna&wr_id=493408
#19009 Angelo 05.02.2023 01:15
Quality articles or reviews is the Car remote key repair
near me (waxue.com: http://waxue.com/bbs/home.php?mod=space&uid=1001982&do=profile) to invite the viewers to go to see the website,
that's what this website is providing.
#19010 Ollie 05.02.2023 01:16
Pretty! This has been an extremely wonderful post.
Many thanks for supplying this info.

Take a look at my page: Auto Locksmith Near
Me Prices: https://ourclassified.net/user/profile/5715512
#19011 Angeline 05.02.2023 01:16
%%

Here is my web site; uk discount code 2023 - Jerilyn: http://www.gomt.co.kr/bbs/board.php?bo_table=free&wr_id=155920 -
#19012 Skye 05.02.2023 01:17
%%

Check out my web site Birth Defect Legal: https://classifieds.lt/index.php?page=user&action=pub_profile&id=6423468
#19013 Ngan 05.02.2023 01:17
Chief executives work in a wide variety of public- and private-sector industries.


Here iis my page ... Anne: http://ionetv.net/things-youll-nothing-like-about-%ec%97%ac%ec%9e%90%ec%95%8c%eb%b0%94-and-things-youll/
#19014 Harris 05.02.2023 01:19
%%

Stop by my web site door fitting wandsworth
(http://modoobiz-shop.co.kr/bbs/board.php?bo_table=free&wr_id=457883: http://modoobiz-shop.co.kr/bbs/board.php?bo_table=free&wr_id=457883)
#19015 Audrey 05.02.2023 01:21
%%

Also visit my webpage :: replacement front door - Siobhan: http://ivimall.com/1068523725/bbs/board.php?bo_table=free&wr_id=20283
-
#19016 Antonia 05.02.2023 01:22
Heⅼlo! Quick question that's completеly off topic.
Do yoս ҝnoѡ how t᧐ make your site mobile
friendly? Ꮇy website looks weird when viewing frߋm mу iphone.
wһere can i get cheap diflucan for sale (diflucan4uѕ.to p: https://diflucan4us.top)'m tгying to find a template ߋr plugin that miցht be ɑble to resolve
tһis prоblem. If you have any recommendations , please share.
Cheers!
#19017 Kory 05.02.2023 01:24
Provided by Tipico Sportsbook accessUSA Now Sports Scores and Sports Betting Oddds hub for
a complete list.

My website :: 안전놀이터 검증: https://lessons.sciren.org/2023/01/26/the-good-the-bad-and-%ec%8a%a4%ed%8f%ac%ec%b8%a0%ed%86%a0%ed%86%a0-%ec%98%a8%eb%9d%bc%ec%9d%b8/
#19018 Amelie 05.02.2023 01:24
This article is genuinely a fastidious one it assists new the
web people, who are wishing for blogging.

Feel free to surf to my web page :: free coloring sheets: https://linktr.ee/coloringly
#19019 Christoper 05.02.2023 01:25
%%

My page; dangerous drugs claim, www.heejinpl.com: http://www.heejinpl.com/bbs/board.php?bo_table=free&wr_id=165754,
#19020 Kian 05.02.2023 01:26
%%

Review my homepage; double Glazing In Manchester: https://www.missionca.org/board/4682924
#19021 Veta 05.02.2023 01:26
I was recommended this website by my cousin. I'm not sure whether this post
is written by him as nobody else know such detailed about my difficulty.
You are incredible! Thanks!

Look at my web site: tattooed pornstars (Http://dino-farm.Com/bbs/board.php?bo_table=gallery&wr_id=1014510: http://dino-farm.com/bbs/board.php?bo_table=gallery&wr_id=1014510)
#19022 Geneva 05.02.2023 01:28
Ӏ սsed to bе recommended thiѕ website via my cousin. I'm now not ѕure
ѡhether this submit is written Ьу means ᧐f him as no
օne else recognise sսch particular abоut my difficulty.
You're amazing! Thank yoᥙ!

Heгe iѕ my web blog ... ߋrder diflucan ᴡithout
rx: https://diflucan4us.top
#19023 Lester 05.02.2023 01:30
%%

Here is my web blog :: Window Fitter Near Me; Www.Prebee.Com: http://www.prebee.com/bbs/board.php?bo_table=free&wr_id=6150,
#19024 Torri 05.02.2023 01:31
We’ve obtained a reeward for our mobile gamers as the MrQ
app is on the signifies soon.

Visit my web-site - 온라인카지노사이트 순위: https://bookmarkswing.com/story14911470/%EC%95%88%EC%A0%84%EC%B9%B4%EC%A7%80%EB%85%B8%EC%82%AC%EC%9D%B4%ED%8A%B8%EC%A3%BC%EC%86%8C-guide-reviews
#19025 Marcos 05.02.2023 01:31
Calculators, Television remotes, cameras, and other standalone devices have concerged into the
smartphone that lives in our pockets.

Also visit my page: 오피스텔 스웨디시: http://www.tteokanaju.co.kr/bbs/board.php?bo_table=free&wr_id=3999
#19026 Numbers 05.02.2023 01:32
%%

My homepage; accident attorneys Liberal (Enriqueta: https://forum.p-z-p.pl/forum/profile/linobarth918457/)
#19027 Wilford 05.02.2023 01:33
Six casinos had far more total gambling revenue in 2022 than they did the year before.


Here is my blog; 승인전화없는 토토사이트: https://www.hirehomeservice.com/hidden-responses-to-%ec%8a%a4%ed%8f%ac%ec%b8%a0%ed%86%a0%ed%86%a0%ec%82%ac%ec%9d%b4%ed%8a%b8-unmasked/
#19028 Bernadine 05.02.2023 01:35
%%

My blog: glass window repair near
Me: http://wsformer.com/bbs/board.php?bo_table=product_main&wr_id=123026
#19029 Christi 05.02.2023 01:35
The on-line sportsbooks below accept registrations from the Bahamas.


Also visit my web-site :: 더존카지노: https://chancey7w5o.angelinsblog.com/18501784/우리카지노샌즈-순위-exposed
#19030 Maynard 05.02.2023 01:35
%%

My web site :: double Glazing
repair hackney: http://no1little.com/bbs/board.php?bo_table=apply&wr_id=126948
#19031 Bobbie 05.02.2023 01:36
Easy to use, low-maintenance protectors that extend the life of your favorite resource: “https://mb.boa rdhost.com/buyo nline/msg/16717 09298.html” footwear or/and
the walking surfaces in your home. You do not need to worry
about washing your blue shoe covers.
#19032 Ingeborg 05.02.2023 01:36
Resume Checker Get your resume checked and scored with 1 click.



My blog post - Reynaldo: https://arthur7sr2c.blogminds.com/recruiting-jobs-locate-recruiter-jobs-talent-acquisition-jobs-with-recruiter-com-14613640
#19033 Santiago 05.02.2023 01:37
%%

Feel free to visit my web site ... Birth Defect compensation: http://boost-engine.ru/mir/home.php?mod=space&uid=3189451&do=profile
#19034 Felipa 05.02.2023 01:37
These can take the type of absolutely free spins, cash back delivers, or
deposit bonuses.

Also visit my blog 우리카지노 메리트 도메인: https://fernandom3j0d.dsiblogger.com/47605151/샌즈카지노-추천-a-summary
#19035 Sienna 05.02.2023 01:38
Earnings morre than this amount are deducted dollar-for-doll ar
from your weekly positive aspects.

My blog post; Anderson: https://bryansphotostudio.com/things-you-have-to-know-about-%EB%B3%B4%EB%8F%84%EA%B5%AC%EC%9D%B8%EA%B5%AC%EC%A7%81/
#19036 Lonnie 05.02.2023 01:39
Some states deduct promotional betting from the calculation, though others need its inclusion inflating the
revenue figure.

My web page :: 파워볼
최상위 사이트: http://cmcbaro.com/bbs/board.php?bo_table=free&wr_id=36894
#19037 Devon 05.02.2023 01:40
%%

My blog post :: Car Key Replacement Biggleswade: http://yugsodan.noriapp.co.kr/bbs/board.php?bo_table=59_consult&wr_id=10820
#19038 Hollie 05.02.2023 01:41
Amazing blog! Do you have any helpful hints for aspiring writers?
I'm planning to start my own blog soon but I'm a little lost on everything.
Would you advise starting with a free platform like Wordpress or go for a
paid option? There are so many options out there that I'm totally overwhelmed ..
Any suggestions? Kudos!

Here is my web page boot mobility scooters uk: https://webscliq.com/car-boot-mobility-scooter-reviews-it-heres-how/
#19039 Mireya 05.02.2023 01:41
Our lenders are excited to enable local residents in Central and Eastern Kentucky with lending needs.


Chesck out my web site 기타 대출: https://rudyardl431nzl5.snack-blog.com/profile
#19040 Norma 05.02.2023 01:42
%%

Look into my page: cost replace windows (dino-farm.com: http://dino-farm.com/bbs/board.php?bo_table=gallery&wr_id=1004963)
#19041 Donny 05.02.2023 01:42
%%

Also visit my blog post - motorcycle accident attorneys
(ttlink.com: http://ttlink.com/reneexrj05/all)
#19042 Laurence 05.02.2023 01:43
A single ccan discover prostitutes and other adult entertainment actions in and about the red light districts of this place.


Feel free to viisit my webpage :: 미수다 알바: https://dante8ef8t.tribunablog.com/stem-jobs-see-uneven-progress-in-increasing-gender-racial-and-ethnic-diversity-30755398
#19043 Athena 05.02.2023 01:43
%%

My webpage Dangerous
drugs Lawyer: http://dwoptron.com/yc/bbs/board.php?bo_table=free&wr_id=156701
#19044 Anya 05.02.2023 01:43
After looking into a few of the blog posts on your website, I truly appreciate your technique of blogging.
I book-marked it to my bookmark webpage list and will be checking back soon. Please visit my
web site too and let blown double glazing repairs near me
(Donnie: http://sj.cresign.net/bbs/board.php?bo_table=sub03_01&wr_id=18642) know your opinion.
#19045 Lolita 05.02.2023 01:45
%%

Here is my web blog: double Glazed window Installers: http://medisweep.co.kr/bbs/board.php?bo_table=free&wr_id=57123
#19046 Magdalena 05.02.2023 01:46
%%

Here is my homepage ... Emergency window glass repair: http://www.yoombook.com/bbs/board.php?bo_table=free&wr_id=112573
#19047 Michell 05.02.2023 01:46
%%

Here is my web blog; netsuite erp partners - http://asonline.Co.kr/bbs/board.php?bo_table=notice&wr_id=24871: http://asonline.co.kr/bbs/board.php?bo_table=notice&wr_id=24871 -
#19048 Florence 05.02.2023 01:47
They have a assortment of bonuses and promotions, and some research will tell
you which ones are worth it.

Also visit my site - 카지노게임규칙: https://francisco394pp.blogozz.com/18693139/the-hidden-gem-of-카지노게임종류
#19049 Ellis 05.02.2023 01:47
%%

Also visit my web page :: workers Compensation Case: http://doctor114.net/bbs/board.php?bo_table=doctor09_06&wr_id=31697
#19050 Jai 05.02.2023 01:48
%%

Here is my website double glazing Romiley (Tecksoftsoluti ons.com: https://tecksoftsolutions.com/fourways-you-should-use-aluminium-doors-romiley-to-change-into-irresistible-to-prospects/)
#19051 Shari 05.02.2023 01:48
%%

Look at my webpage; dangerous Drugs Lawsuit: https://www.sitiosecuador.com/author/dustydarrel/
#19052 Nelly 05.02.2023 01:48
The deal is traditionally performed two at a time, two cards to
every single player, two cards to the table, and two cards
to the dealer.

Have a look at my blog 코인카지노: https://marcoj1f9z.ambien-blog.com/21732384/buying-우리카지노-퍼스트-주소
#19053 Mervin 05.02.2023 01:49
%%

My web blog - lelo male masturbator; http://www.thephoneshop.co.kr/: http://www.thephoneshop.co.kr/bbs/board.php?bo_table=review&wr_id=95702,
#19054 Rigoberto 05.02.2023 01:50
For instance, a $1,000 loan borrowed over 6 months is a
total of $1,440 ($1,000 principle, $200 establishment feee and
$240 in monthly interest).

Here is my website; 사업자대출: https://gorillasocialwork.com/story13553916/the-unadvertised-details-into-%EA%B0%9C%EC%9D%B8%EB%8F%88%EB%8C%80%EC%B6%9C-that-most-people-don-t-learn-about
#19055 Isidro 05.02.2023 01:50
Meanwhile, the Powerball jackpot is at $378 million with a
cash solution of $198.7 million, according to the Powerball web-site.


Feel free to surf to my webpage - 동행키노사다리: https://ricardoo4n2i.vidublog.com/18754719/the-ultimate-스피드키노-패턴-trick
#19056 Shawnee 05.02.2023 01:52
When playing on line in PA, you know that you are as protected as you would be in a land-based
casino.

Visit my site; 카지노 추천은 카지노친구: https://solutionpartners.com.tr/blog/index.php?entryid=141339
#19057 Nicholas 05.02.2023 01:53
There are other variations to the multiplier symbol such as wild multipliers, which
can act as a sevede advantage to you and your game.

Also visit my web page 카지노강원랜드: http://classified2.kmcbuxar.com/index.php?page=user&action=pub_profile&id=76553
#19058 Jerald 05.02.2023 01:55
%%

Here is my homepage Veterans disability Lawyers: http://ttlink.com/fatimamapl/all
#19059 Kieran 05.02.2023 01:56
“Being touched by a licensed therapist and working on relaxing your physique can be useful for discomfort management,” says Loncar.


my site: 스웨디시
구분법: http://aynilshop.com/bbs/board.php?bo_table=free&wr_id=23709
#19060 Michaela 05.02.2023 01:57
The Governmen of the Republic of Korea fully mesets the minimum standards for the elimination of trafficking.


Here is my homepage: 룸살롱 구인구직: http://thetaxclub.org/community/profile/finnfogle367042/
#19061 Roger 05.02.2023 01:57
%%

Have a look at my web site best netsuite consultants: https://ntos.kr:443/bbs/board.php?bo_table=free&wr_id=1429931

Добавить комментарий

Защитный код
Обновить

Бесплатная консультация

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

Бесплатная консультация по телефону:

+7 917 4373926
Ежедневно c 10:00ч до 20:00ч.

 

Услуги | Портфолио | Блог | РБ
Перепечатка информации с сайта www.goinweb.ru, возможна только с указанием активной гиперссылки.
Веб-студия «GOINWEB»: Разработка, продвижение, обслуживание и поддержка веб-сайтов. E-mail:feedback@goinweb.ru
Яндекс.Метрика