sudo curl -o /usr/local/bin/internet-off \
https://gist.githubusercontent.com/jfromaniello/9d2b0383feed978afdb4/raw/internet-off
sudo chmod +x /usr/local/bin/internet-off
sudo internet-off
Credits to John1024 for his answer:
sudo curl -o /usr/local/bin/internet-off \
https://gist.githubusercontent.com/jfromaniello/9d2b0383feed978afdb4/raw/internet-off
sudo chmod +x /usr/local/bin/internet-off
sudo internet-off
Credits to John1024 for his answer:
#!/bin/bash | |
GW=$(sudo /sbin/route -n | awk '{if ($1=="0.0.0.0") {print $2} ; q}') | |
/sbin/route del default gw "$GW" | |
echo "Use this to turn on internet:" | |
echo " sudo /sbin/route add default gw $GW" |