commit 3beef7fe82206e97fbcdab13646506000af37294 from: gonzalo date: Mon May 18 08:19:53 2020 UTC Add reset-net, I use this to reset my network ifs and vpn commit - ece30e20ab77a7ff761cbb909d49dee51105632d commit + 3beef7fe82206e97fbcdab13646506000af37294 blob - /dev/null blob + 94746d249c62ea0364b6cf86b1b36f09ea4323d9 (mode 644) --- /dev/null +++ reset-net @@ -0,0 +1,24 @@ +#!/bin/sh + +if test "$(whoami)" != root; then + doas "$0" "$@" + exit $? +fi + +printf "[+] Killing OpenVPN\n" +pkill -9 -x openvpn >/dev/null +pkill -9 -x openvpn >/dev/null +pkill -9 -x openvpn >/dev/null +printf "[+] Destroying tun*\n" +ifconfig tun0 down >/dev/null +ifconfig tun0 destroy >/dev/null +printf "[+] Marking down axen0 & iwm0\n" +ifconfig axen0 down >/dev/null +ifconfig iwm0 down >/dev/null +printf "[+] Marking down trunk0\n" +ifconfig trunk0 destroy >/dev/null +ifconfig trunk0 destroy >/dev/null +printf "[+] Flushing routes\n" +route -n flush >/dev/null +printf "[+] Starting networking with VPN\n" +sh /etc/netstart