summaryrefslogtreecommitdiffstats
path: root/skripti/remove_ipv6_on_disconnect.sh
diff options
context:
space:
mode:
Diffstat (limited to 'skripti/remove_ipv6_on_disconnect.sh')
-rwxr-xr-xskripti/remove_ipv6_on_disconnect.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/skripti/remove_ipv6_on_disconnect.sh b/skripti/remove_ipv6_on_disconnect.sh
new file mode 100755
index 0000000..a227688
--- /dev/null
+++ b/skripti/remove_ipv6_on_disconnect.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -xe
+tail --follow=name --retry /var/log/syslog | grep "default route via" | while read l
+do
+ iface=`cut -d\ -f6 <<<"$l" | sed s/://`
+ ip -6 route | grep $iface | while read line
+ do
+ ip route del $line
+ done
+done