12 063
правки
(Новая страница: «# 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> | ||
# | # 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: | ||
## | ## Install ''cron'': <syntaxhighlight lang="bash"> | ||
apt-get install cron | apt-get install cron | ||
</syntaxhighlight> | </syntaxhighlight> | ||
## | ## 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> | ||
правки