From f480e141f5a581b31f2d145f1a8e73f7c08defb9 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 5 Apr 2022 15:52:14 +0200 Subject: [PATCH] Adding snippets/tpl.085.disable-ipv6.sh --- snippets/tpl.085.disable-ipv6.sh | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 snippets/tpl.085.disable-ipv6.sh diff --git a/snippets/tpl.085.disable-ipv6.sh b/snippets/tpl.085.disable-ipv6.sh new file mode 100644 index 0000000..0864910 --- /dev/null +++ b/snippets/tpl.085.disable-ipv6.sh @@ -0,0 +1,33 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +disable_ipv6() { + + echo -e "\e[0Ksection_start:$( date +%s ):ks_disable_ipv6[collapsed=true]\r\e[0KDisabling IPv6 in /etc/sysctl.conf ..." + echo + echo "${HASH_LINE}" + echo + log "Disabling IPv6 in /etc/sysctl.conf ..." + + local sysctl_conf="/etc/sysctl.conf" + + echo >>"${sysctl_conf}" + echo "# Disabling IPv6" >>"${sysctl_conf}" + echo "net.ipv6.conf.all.disable_ipv6 = 1" >>"${sysctl_conf}" + echo "net.ipv6.conf.default.disable_ipv6 = 1" >>"${sysctl_conf}" + echo >>"${sysctl_conf}" + + echo + echo "${HASH_LINE}" + echo "Inhalt von '${sysctl_conf}':" + cat "${sysctl_conf}" | grep -v -P '^[ ]*(#|$)' + echo + + echo -e "\e[0Ksection_end:$( date +%s ):ks_disable_ipv6\r\e[0K" +} + +disable_ipv6 + +#end raw +## vim: ts=4 et list -- 2.39.5