summaryrefslogtreecommitdiffstats
path: root/skripti/remove_ipv6_on_disconnect.sh
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2023-10-07 14:27:44 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2023-10-07 14:27:44 +0200
commit69e576308aefd92d8af7a5bcb060e5929d7becb7 (patch)
tree38bb6a9e6274eaef64e6155f74f90023a7919b58 /skripti/remove_ipv6_on_disconnect.sh
parentponastavi update (diff)
downloadr-69e576308aefd92d8af7a5bcb060e5929d7becb7.tar
r-69e576308aefd92d8af7a5bcb060e5929d7becb7.tar.gz
r-69e576308aefd92d8af7a5bcb060e5929d7becb7.tar.bz2
r-69e576308aefd92d8af7a5bcb060e5929d7becb7.tar.lz
r-69e576308aefd92d8af7a5bcb060e5929d7becb7.tar.xz
r-69e576308aefd92d8af7a5bcb060e5929d7becb7.tar.zst
r-69e576308aefd92d8af7a5bcb060e5929d7becb7.zip
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