Если у вас есть роутер ASUS или другой с прошивкой от Олега, то эта записка для вас. Недавно у меня возникла трудность, которую никак не получалось решить. VPN-сессия зависала, при этом VPN-соединение оставалось подключено. Роутер не мог понять, что надо переподключится. Приходилось каждый раз вручную делать перезагрузку роутера, согласитесь, это долгий и утомительный процесс.
Я покопался в интернете, оказалось я такой не один и проблема довольно масштабна среди “роутороводов”. Наши провайдеры не особо жалуют пользователей с роутерами, в большинстве случаев после ответа на вопрос “какая у вас операционная система” суппорт умолкает.
Я не задавался и продолжал искать, но нигде не было универсального решения данной проблемы. Тогда я подумал, мой роутер основан на 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
Доброго времени суток! Скажите пожалуйста, а можно таким способом перезагружать другую точку, коротая подключена к моей мостом?
Бесплатная консультация по телефону:
Комментарии
I have learn this put up and if I may I want to recommend you some
fascinating issues or tips. Perhaps you could write next articles relating to this article.
I wish to learn more issues approximately it!
onion dark website: https://darkmarketlegion.com https://darkmarketlegion.com
I'm trying to find out if its a problem on my end or if it's the blog.
Any responses would be greatly appreciated. darknet markets
onion: https://darkmarketlegion.com https://darkmarketlegion.com
for me to visit this site, it includes precious Information. darknet markets
2024: https://darkmarketlegion.com https://darkmarketlegion.com
About Coffeee Machine Which coffee machine is
best: https://securityholes.science/wiki/Why_We_Love_Bean_To_Cup_Coffee_Machine_And_You_Should_Also
near me: http://p.r.os.p.e.r.les.cpezedium.free.fr?a%5B%5D=%3Ca+href%3Dhttps%3A%2F%2Fwww.google.hn%2Furl%3Fq%3Dhttps%3A%2F%2Fliuxf.com%2F%3Esex+on+facebook%3C%2Fa%3E%3Cmeta+http-equiv%3Drefresh+content%3D0%3Burl%3Dhttps%3A%2F%2Fimages.google.bs%2Furl%3Fq%3Dhttps%3A%2F%2Fliuxf.com%2F+%2F%3E
This put up actually made my day. You cann't imagine just how so much time I had spent for this information! Thank you!
dark web sites: https://darkmarketgate.com https://darkmarketgate.com
bunk beds (https://www.diggerslist.com: https://www.diggerslist.com/66272ae02848d/about)
https://darkmarketlegion.com
near me: http://Rlu.ru/3yRiF
this website as a most excellent web page for most
up-to-date updates. dark market link: https://darkmarketlegion.com https://darkmarketlegion.com
interesting article like yours. It is pretty worth enough for me.
In my opinion, if all web owners and bloggers made good content as you did, the net will be much more useful than ever before.
my web blog ... jus buah segar: https://juisable.id/
layout on your weblog. Is this a paid theme or did you customize it yourself?
Anyway keep up the nice quality writing, it's rare to see a great
blog like this one today. darkmarket list: https://darkmarketlegion.com https://darkmarketlegion.com
sex near me: http://Pearlimport.net/__media__/js/netsoltrademark.php?d=Www.Facebookofsex.yaforia.com
Feel free to visit my web blog - jus buah: https://juisable.id/
(from what I've read) Is that what you are using on your blog?
darkmarket 2024: https://darkmarketlegion.com https://darkmarketlegion.com
trainees throughout their academic journey. As a person that has actually
made use of these solutions, I can personally vouch for their substantial impact on my academic success.
research
paper writers: https://www.linkedin.com/pulse/speedypaper-review-skillhubcom-pvhne
I reverberate deeply with the emphasis placed on experienced assistance,
quality control, and effective time monitoring. Having access to experienced writers who
offer tailored support has significantly improved the quality of my essays and deepened
my comprehension of tough topics.
Additionally, the assurance of creativity and adherence to academic standards has actually instilled
confidence in me, knowing that my job is genuine and reputable.
In addition, the prompt distribution of essays
has enabled me to remain arranged with my jobs and ease last-minute
stress.
To conclude, I completely agree with the sentiments
shared in this discussion forum string. Essay writing services are vital resources for students pursuing academic quality, and I am grateful for the advantages they have actually given in assisting me reach my
educational goals.
local car locksmiths (Angelica: https://doodleordie.com/profile/dillpeen69)
Boss cerebral palsy lawsuit; Cathleen: https://gokseong.multiiq.com/bbs/board.php?bo_table=free&wr_id=991919,
and thought I might as well check things out. I like what
I see so i am just following you. Look forward
to looking at your web page yet again. darknet
markets onion: https://darkmarketlegion.com https://darkmarketlegion.com
facebook: http://clampitup.net/__media__/js/netsoltrademark.php?d=www.google.im%2Furl%3Fq%3Dhttps%3A%2F%2Fwww.facebookofsex.yaforia.com%2F
urls
to write.
Feel free to visit my page ... перетяжка мягкой мебели: http://informatief.financieeldossier.nl/index.php?url=https://fccland.ru/novosti/43220-plyusy-i-minusy-peretyazhki-myagkoy-mebeli-stoit-li-obnovlyat-staryy-divan-ili-kreslo.html
to find sex near me: http://lommen.construction/__media__/js/netsoltrademark.php?d=www.facebookofsex.yaforia.com
Clarice: http://roboticlungcanceroperation.com/__media__/js/netsoltrademark.php?d=facebookofsex.yaforia.com,
real money casino: https://getb8.us/online-casinos/
new casino
new mobile casino: https://getb8.us/online-casinos/
casinos
truly remarkable.
Here iis my web page; magazynier szwajcaria (https://issuu.com/damprace: https://issuu.com/damprace)
me: http://.O.rcu.Pineoxs.a.pro.wanadoo.frsrv5.cineteck.net/phpinfo/?a%5B%5D=%3Ca+href%3Dhttp%3A%2F%2FChipafangranch.com%2F__media__%2Fjs%2Fnetsoltrademark.php%3Fd%3DWww.Facebookofsex.yaforia.com%3Elocal+hookup+facebook%3C%2Fa%3E%3Cmeta+http-equiv%3Drefresh+content%3D0%3Burl%3Dhttp%3A%2F%2Fapplaud.net%2F__media__%2Fjs%2Fnetsoltrademark.php%3Fd%3Dwww.Facebookofsex.Yaforia.com+%2F%3E
near me: http://.O.rcu.Pineoxs.a.pro.wdoo.frsrv5.cineteck.net/phpinfo/?a%5B%5D=%3Ca+href%3Dhttp%3A%2F%2Fdigitalrockstar.com%2F__media__%2Fjs%2Fnetsoltrademark.php%3Fd%3DWww.facebookofsex.Yaforia.com%3Esex+partners+near+me%3C%2Fa%3E%3Cmeta+http-equiv%3Drefresh+content%3D0%3Burl%3Dhttp%3A%2F%2Ffluidpowerseal.com%2F__media__%2Fjs%2Fnetsoltrademark.php%3Fd%3Dfacebookofsex.Yaforia.com+%2F%3E)
Locksmith Service: https://fapset.com/user/birdmaple4/
به داخل آن جلوگیری شود.
بنابراین افرادی که جزء خریداران و متقاضیان اصلی این البسه هستند می
توانند در تمامی فصول سال مدل های
موردپسند خود را مطابق با شرایط آب و هوایی تهیه کنند
و این خود یک نوع مزیت به شمار می رود.
My blog post: کلاس یوس: https://nastoor.ir/2024/03/03/%d8%a2%d8%b2%d9%85%d9%88%d9%86-yos-%d8%aa%d8%b1%da%a9%db%8c%d9%87-%d8%af%d8%b1%d9%88%d8%a7%d8%b2%d9%87-%d9%88%d8%b1%d9%88%d8%af-%d8%a8%d9%87-%d8%af%d8%a7%d9%86%d8%b4%da%af%d8%a7%d9%87%d9%87/
The sketch is tasteful, your authored material stylish.
nonetheless, you command get got an nervousness
over that you wish be delivering the following. unwell unquestionably come further formerly again since exactly the same nearly very
often inside case you shield this increase.
Check out my site: Learn More: https://www.diggerslist.com/6629e44becde4/about
me: http://https%253a%252f%evolv.elUpchaedongacademy.org/phpinfo.php?a%5B%5D=%3Ca+href%3Dhttp%3A%2F%2Frmbroad.com%2F__media__%2Fjs%2Fnetsoltrademark.php%3Fd%3Dfacebookofsex.Yaforia.com%3Elocal+hookups+near+me%3C%2Fa%3E%3Cmeta+http-equiv%3Drefresh+content%3D0%3Burl%3Dhttp%3A%2F%2Ffanimationfanfans.com%2F__media__%2Fjs%2Fnetsoltrademark.php%3Fd%3Dwww.Facebookofsex.yaforia.com+%2F%3E
I have joined your feed and look forward to in search of mode of
your wonderful post. Additionally, I've shared your site in my social networks
my web-site :: dam prace łowicz: https://Peatix.com/user/21926069/view
Если Вы хотите, чтоб Ваш сайт привлекал
как можно больше посетителей,
то нужно, чтоб он был не только полезным и удобным, но и хорошо оптимизированны м для поисковиков.
то потребует немало усилий и затрат,однако если
хотите здорово ускорить процесс
и ощутимо поднять сайт в результате выдачи,
то можно использовать. Таким образом Вы можете не только быстрей [ой] желаемый
результат, но и даже сэкономить время и деньги.
ДЛЯ СВЯЗИ С НАМИ ПИШИТЕ В СКАЙП ЛОГИН
POKRAS7777: https://join.skype.com/AnXAQ9LfhMi8
ЛИБО В логин @pokras777 НАША ГРУППА В ТЕЛЕГРАММ: https://t.me/bazixrumer
b5JjiwV5-3
Check out my homepage; прогонов хрумером: http://www.silvergram.com/__media__/js/netsoltrademark.php?d=cse.google.com.mx%2Furl%3Fq%3Dhttps%3A%2F%2Fseoprofisional.ru%2Fbazy%2Fprogon-xrumer