Initial Commit
This commit is contained in:
27
apsetup/usr/local/bin/wap-disable
Normal file
27
apsetup/usr/local/bin/wap-disable
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# Disable PiWifiAP wireless access point
|
||||
|
||||
current_user=`whoami`
|
||||
if [ "$current_user" != "root" ]
|
||||
then
|
||||
echo "You must have root privileges to run this setup."
|
||||
echo "Try 'sudo $0'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source /etc/piwifiap.conf
|
||||
|
||||
if [ "$network_system" = "systemd-networkd" ]
|
||||
then
|
||||
systemctl stop hostapd
|
||||
systemctl disable hostapd
|
||||
elif [ "$network_system" = "NetworkManager" ]
|
||||
then
|
||||
nmcli con down piwifi-ap
|
||||
nmcli con mod piwifi-ap autoconnect no
|
||||
else
|
||||
echo "Unable to determine what type of network configuration (systemd-networkd"
|
||||
echo "or NetworkManager) your system uses."
|
||||
echo "Cannot disable wireless access point."
|
||||
exit 2
|
||||
fi
|
||||
Reference in New Issue
Block a user