From: Frank Brehm Date: Tue, 5 Apr 2022 13:52:14 +0000 (+0200) Subject: Adding snippets/tpl.085.disable-ipv6.sh X-Git-Tag: 2.3.6^2~2^2~1 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=f480e141f5a581b31f2d145f1a8e73f7c08defb9;p=pixelpark%2Fcreate-vmware-tpl.git Adding 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