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

Материал из Wiren Board
м (FuzzyBot переименовал страницу Translations:Wi-Fi/24/en в Translations:Wi-Fi Old/24/en без оставления перенаправления: Часть переводимой страницы Wi-Fi.)
 

Текущая версия на 15:56, 23 октября 2023

Определение сообщения (Wi-Fi Old)
# If the return code from ping ($?) is not 0 (meaning there was an error)
if [ $? != 0 ]
then
# Restart the wireless interface
ifdown --force ${WLANINTERFACE}
ifup ${WLANINTERFACE}
fi
</syntaxhighlight>
# Сделайте файл исполняемым, выполнив команду <syntaxhighlight lang="bash">
chmod +x /root/wifi_autoconnect.sh
</syntaxhighlight>
# Запланируйте выполнение скрипта каждую минуту. Для этого:
## Установите ''cron'': <syntaxhighlight lang="bash">
apt-get install cron
</syntaxhighlight>
## Добавьте в конец файла <code>/etc/crontab</code> строку<syntaxhighlight lang="bash">
*  * * * * root /root/wifi_autoconnect.sh
# обязательно добавьте пустую строку в конец файла
</syntaxhighlight>
  1. If the return code from ping ($?) is not 0 (meaning there was an error)

if [ $? != 0 ] then

  1. Restart the wireless interface

ifdown --force ${WLANINTERFACE} ifup ${WLANINTERFACE} fi </syntaxhighlight>

  1. Make file executable by running the command
    chmod +x /root/wifi_autoconnect.sh
    
  2. Schedule the script to run every minute. For this:
    1. Install cron:
      apt-get install cron
      
    2. In the end of the/etc/crontab file add line
      *  *	* * *	root	/root/wifi_autoconnect.sh
      # be sure to add an empty line at the end of the file