]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding snippets/tpl.085.disable-ipv6.sh
authorFrank Brehm <frank@brehm-online.com>
Tue, 5 Apr 2022 13:52:14 +0000 (15:52 +0200)
committerFrank Brehm <frank@brehm-online.com>
Tue, 5 Apr 2022 13:52:14 +0000 (15:52 +0200)
snippets/tpl.085.disable-ipv6.sh [new file with mode: 0644]

diff --git a/snippets/tpl.085.disable-ipv6.sh b/snippets/tpl.085.disable-ipv6.sh
new file mode 100644 (file)
index 0000000..0864910
--- /dev/null
@@ -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