termux-api-package/scripts/termux-wifi-enable

21 lines
388 B
Plaintext
Raw Normal View History

2018-06-06 02:48:33 +02:00
#!/data/data/com.termux/files/usr/bin/sh
set -e -u
SCRIPTNAME=termux-wifi-enable
show_usage () {
echo "Usage: $SCRIPTNAME [true | false]"
echo "Toggle Wi-Fi On/Off"
exit 1
}
if [ "$#" -ne 1 ]; then
show_usage
fi
2018-06-06 03:13:43 +02:00
case $1 in
true|false);;
*) show_usage;;
esac
2018-06-06 02:48:33 +02:00
/data/data/com.termux/files/usr/libexec/termux-api WifiEnable --ez enabled $1