#!/bin/bash CONFIG=/usr/share/wifi_config if ps ax | grep -v grep | grep wpa_supplicant > /dev/null then echo -e " \E[1;32m********************************************************************************* * * * WiFi already started * * * *********************************************************************************\E[0m "; else if [ -e $CONFIG ] then echo -e " \E[1;33m********************************************************************************* * * * WiFi starting... * * * *********************************************************************************\E[0m " wpa_supplicant -Dwext -iwlan0 -c$CONFIG & > /dev/null sleep 3 dhcpcd wlan0 >> /dev/null echo -e " \E[1;32m********************************************************************************* * * * WiFi starting success! * * * *********************************************************************************\E[0m "; else echo -e " \E[1;31m********************************************************************************* * Config file not exist, use: * * \E[01;32mwpa_passphrase SSID LOGIN PASSWORD >> /usr/share/wifi_config\E[1;31m * * and start this script again. * *********************************************************************************\E[0m "; fi fi
chmod +x /wifi
ln -s /wifi /usr/bin/startwifi
startwifi
Source: https://habr.com/ru/post/148689/
All Articles