]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding snippets/tpl.230.vimrc-centos8.sh
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 22 Jun 2020 14:46:08 +0000 (16:46 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 22 Jun 2020 14:46:08 +0000 (16:46 +0200)
kickstart/template-centos8.ks
snippets/tpl.230.vimrc-centos8.sh [new file with mode: 0644]

index bddfbd683e2dd99ab1185866295b46397127abe3..d3784d78c1fa1e2af185d6dd13ba62b0b31f3ff6 100644 (file)
@@ -212,6 +212,11 @@ echo
 echo "Using snippet $locales_snippet"
 $SNIPPET($locales_snippet)
 
+#set $vimrc_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.230.vimrc-centos8.sh"
+echo
+echo "Using snippet $vimrc_snippet"
+$SNIPPET($vimrc_snippet)
+
 #set $pkgs_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.250.pkgs-centos8.sh"
 echo
 echo "Using snippet $pkgs_snippet"
diff --git a/snippets/tpl.230.vimrc-centos8.sh b/snippets/tpl.230.vimrc-centos8.sh
new file mode 100644 (file)
index 0000000..8188b5a
--- /dev/null
@@ -0,0 +1,30 @@
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+set_vimrc_centos8() {
+
+    echo
+    echo "${HASH_LINE}"
+    echo "Calling set_vimrc_centos8() ..."
+    echo
+    local url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/vimrc-centos8"
+
+    echo
+    log "Rewriting /etc/vimrc ..."
+
+    local tmp_file=$( mktemp )
+    wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true
+    if [[ -s "${tmp_file}" ]] ; then
+        cp -p /etc/vimrc /etc/vimrc.original
+        mv -v "${tmp_file}" /etc/vimrc
+        chmod -v 0644 /etc/vimrc
+    fi
+    rm -fv "${tmp_file}"
+
+}
+
+set_vimrc_centos8
+
+#end raw
+## vim: ts=4 et list