实现功能为按一下wifi打开,再按一下wifi关闭。
#!/bin/bash
foo=$(ifconfig ra0 | grep UP)
if [ "$foo" = "" ]
then
echo "turn on wifi"
ifconfig ra0 up
else
echo "turn off wifi"
ifconfig ra0 down
fi
实现功能为按一下wifi打开,再按一下wifi关闭。
#!/bin/bash
foo=$(ifconfig ra0 | grep UP)
if [ "$foo" = "" ]
then
echo "turn on wifi"
ifconfig ra0 up
else
echo "turn off wifi"
ifconfig ra0 down
fi