<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; CMD/BAT: Перегрузка роутера]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10639</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10639&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «CMD/BAT: Перегрузка роутера».]]></description>
		<lastBuildDate>Fri, 15 May 2015 21:22:46 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: CMD/BAT: Перегрузка роутера]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=93987#p93987</link>
			<description><![CDATA[<div class="codebox"><pre><code>
Set FirstPing=ya.ru
Set SecondPing=google.com
c:
cd\
cd Checker
ping %FirstPing% | Find /v &quot;Ответ от 192.168.0.200&quot; | Find /c &quot;Ответ&quot;
If %ErrorLevel% == 1 Goto :!SecondPing
Goto :!Exit
:!SecondPing
Echo %Date% %Time% %FirstPing% не доступен.&gt;&gt;%ComputerName%.log
ping %SecondPing% | Find /v &quot;Ответ от 192.168.0.200&quot; | Find /c &quot;Ответ&quot;
If %ErrorLevel% == 1 Goto :!Reboot
Goto :!Exit
:!Reboot
taskkill -f -im kitty.exe
Echo %Date% %Time% %SecondPing% не доступен. Перезагрузка роутера.&gt;&gt;%ComputerName%.log
kitty.exe -telnet 192.168.0.1 -cmd admin\npassword\nshell\nreboot\n
:!Exit
</code></pre></div><p>0.1) У роутера открыт telnet (ssh)<br />0.2) Все ip мои, так что под себя нужно дорабатывать<br />1) kitty - одна из реализаций putty, умеющая передавать данные в telnet<br />2) &quot;Ответ от &quot; нужно писать в кодировке 866, ибо русский и cmd<br />3) Если важно скрыть от пользователя, то можно запускать из vbs<br /></p><div class="codebox"><pre><code>
Set WshShell = CreateObject(&quot;WScript.Shell&quot;)
WshShell.Run &quot;cmd /c &quot; &amp; ПутьК.cmd, 0, False
</code></pre></div><p>В общем, направление задано. Скрипт работает на реальных объектах.</p>]]></description>
			<author><![CDATA[null@example.com (MikeSh)]]></author>
			<pubDate>Fri, 15 May 2015 21:22:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=93987#p93987</guid>
		</item>
		<item>
			<title><![CDATA[CMD/BAT: Перегрузка роутера]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=93904#p93904</link>
			<description><![CDATA[<p>Всем привет,помогите решить проблему,нужен батник который делал ping DNS,если ошибка запускал перегрузку роутера,желательно чтоб пользователь это не видел.</p>]]></description>
			<author><![CDATA[null@example.com (sprintserv)]]></author>
			<pubDate>Mon, 11 May 2015 20:21:26 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=93904#p93904</guid>
		</item>
	</channel>
</rss>
