auto-disable-wifi/install.sh

21 lines
580 B
Bash
Raw Normal View History

2022-03-16 18:22:50 +01:00
#!/usr/bin/env bash
run_directory=$(dirname "$0")
if [ -f $run_directory/.disabled ]; then
echo "Installation is disabled. Exiting..."
exit 0
fi
echo "Copying script to NetworkManager directory..."
sudo cp $run_directory/auto-disable-wifi.sh /etc/NetworkManager/dispatcher.d/99-auto-disable-wifi
sudo chown root:root /etc/NetworkManager/dispatcher.d/99-auto-disable-wifi
sudo chmod 744 /etc/NetworkManager/dispatcher.d/99-auto-disable-wifi
if ! command -v rfkill &> /dev/null; then
echo "WARNING: rfkill is not installed."
fi
echo "Finished install. Exiting..."
exit 0