Перейти к содержанию

Навигация

Wi-Fi Old/en: различия между версиями

Новая страница: «# If the return code from ping ($?) is not 0 (meaning there was an error) if [ $? != 0 ] then # Restart the wireless interface ifdown --force ${WLANINTERFACE} ifu…»
(Новая страница: «# Substitute the name of the interface WLANINTERFACE=wlan1 # Substitute the address of the router or server on the Internet, access to which will be checked SERVE…»)
(Новая страница: «# If the return code from ping ($?) is not 0 (meaning there was an error) if [ $? != 0 ] then # Restart the wireless interface ifdown --force ${WLANINTERFACE} ifu…»)
Строка 188: Строка 188:
fi
fi
</syntaxhighlight>
</syntaxhighlight>
# Сделайте файл исполняемым, выполнив команду <syntaxhighlight lang="bash">
# Make the file executable by running the command <syntaxhighlight lang="bash">
chmod +x /root/wifi_autoconnect.sh
chmod +x /root/wifi_autoconnect.sh
</syntaxhighlight>
</syntaxhighlight>
# Запланируйте выполнение скрипта каждую минуту. Для этого:
# Schedule the script to run every minute. For this:
## Установите ''cron'': <syntaxhighlight lang="bash">
## Install ''cron'': <syntaxhighlight lang="bash">
apt-get install cron
apt-get install cron
</syntaxhighlight>
</syntaxhighlight>
## Добавьте в конец файла <code>/etc/crontab</code> строку<syntaxhighlight lang="bash">
## In the end of the<code>/etc/crontab</code> file add line<syntaxhighlight lang="bash">
*  * * * * root /root/wifi_autoconnect.sh
*  * * * * root /root/wifi_autoconnect.sh
# обязательно добавьте пустую строку в конец файла
# be sure to add an empty line at the end of the file
</syntaxhighlight>
</syntaxhighlight>


12 063

правки