echo
log "Cleaning YUM repos and making cache ..."
- yum clean all
- yum makecache
+ if [[ -x /bin/dnf ]] ; then
+ dnf clean all
+ dnf makecache
+ else
+ yum clean all
+ yum makecache
+ fi
echo -e "\e[0Ksection_end:$( date +%s ):ks_init_yum_repos\r\e[0K"
}
+++ /dev/null
-## !/bin/bash
-#raw
-
-#-----------------------------------------------------------
-set_bashrc_centos8() {
-
- echo -e "\e[0Ksection_start:$( date +%s ):ks_set_bashrc_centos8[collapsed=true]\r\e[0KRewriting /etc/bashrc ..."
- echo
- echo "${HASH_LINE}"
- echo "Calling set_bashrc_centos8() ..."
- echo
- local url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/bashrc-centos8"
-
- echo
- log "Rewriting /etc/bashrc ..."
-
- 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/bashrc /etc/bashrc.original
- mv -v "${tmp_file}" /etc/bashrc
- chmod -v 0644 /etc/bashrc
- fi
- rm -fv "${tmp_file}"
-
- echo
- log "Installing bash-completion ..."
- if yum install -y "bash-completion" ; then
- :
- else
- echo "[$(date)]: Could not install bash-completion" | tee -a "${ERROR_POINTER}"
- fi
-
- echo -e "\e[0Ksection_end:$( date +%s ):ks_set_bashrc_centos8\r\e[0K"
-}
-
-set_bashrc_centos8
-
-#end raw
-## vim: ts=4 et list
--- /dev/null
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+set_bashrc_centos8() {
+
+ echo -e "\e[0Ksection_start:$( date +%s ):ks_set_bashrc_centos8[collapsed=true]\r\e[0KRewriting /etc/bashrc ..."
+ echo
+ echo "${HASH_LINE}"
+ echo "Calling set_bashrc_centos8() ..."
+ echo
+ local url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/bashrc-centos8"
+
+ echo
+ log "Rewriting /etc/bashrc ..."
+
+ 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/bashrc /etc/bashrc.original
+ mv -v "${tmp_file}" /etc/bashrc
+ chmod -v 0644 /etc/bashrc
+ fi
+ rm -fv "${tmp_file}"
+
+ echo
+ log "Installing bash-completion ..."
+ if yum install -y "bash-completion" ; then
+ :
+ else
+ echo "[$(date)]: Could not install bash-completion" | tee -a "${ERROR_POINTER}"
+ fi
+
+ echo -e "\e[0Ksection_end:$( date +%s ):ks_set_bashrc_centos8\r\e[0K"
+}
+
+set_bashrc_centos8
+
+#end raw
+## vim: ts=4 et list
--- /dev/null
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+set_bashrc_centos8() {
+
+ echo -e "\e[0Ksection_start:$( date +%s ):ks_set_bashrc_centos8[collapsed=true]\r\e[0KRewriting /etc/bashrc ..."
+ echo
+ echo "${HASH_LINE}"
+ echo "Calling set_bashrc_centos8() ..."
+ echo
+ local url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/bashrc-centos8"
+
+ echo
+ log "Rewriting /etc/bashrc ..."
+
+ 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/bashrc /etc/bashrc.original
+ mv -v "${tmp_file}" /etc/bashrc
+ chmod -v 0644 /etc/bashrc
+ fi
+ rm -fv "${tmp_file}"
+
+ echo
+ log "Installing bash-completion ..."
+ if yum install -y "bash-completion" ; then
+ :
+ else
+ echo "[$(date)]: Could not install bash-completion" | tee -a "${ERROR_POINTER}"
+ fi
+
+ echo -e "\e[0Ksection_end:$( date +%s ):ks_set_bashrc_centos8\r\e[0K"
+}
+
+set_bashrc_centos8
+
+#end raw
+## vim: ts=4 et list
+++ /dev/null
-## !/bin/bash
-#raw
-
-#-----------------------------------------------------------
-set_locales_centos8() {
-
- echo -e "\e[0Ksection_start:$( date +%s ):ks_set_locales_centos8[collapsed=true]\r\e[0KInstalling german locales ..."
- echo
- echo "${HASH_LINE}"
- echo "Calling set_locales_centos8() ..."
- echo
-
- log "Installing german locales (langpacks-de) ..."
- if yum install -y "langpacks-de" ; then
- :
- else
- echo "[$(date)]: Could not install german locales (langpacks-de)" | tee -a "${ERROR_POINTER}"
- fi
-
- echo -e "\e[0Ksection_end:$( date +%s ):ks_set_locales_centos8\r\e[0K"
-}
-
-set_locales_centos8
-
-#end raw
-## vim: ts=4 et list
--- /dev/null
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+set_locales_centos8() {
+
+ echo -e "\e[0Ksection_start:$( date +%s ):ks_set_locales_centos8[collapsed=true]\r\e[0KInstalling german locales ..."
+ echo
+ echo "${HASH_LINE}"
+ echo "Calling set_locales_centos8() ..."
+ echo
+
+ log "Installing german locales (langpacks-de) ..."
+ if yum install -y "langpacks-de" ; then
+ :
+ else
+ echo "[$(date)]: Could not install german locales (langpacks-de)" | tee -a "${ERROR_POINTER}"
+ fi
+
+ echo -e "\e[0Ksection_end:$( date +%s ):ks_set_locales_centos8\r\e[0K"
+}
+
+set_locales_centos8
+
+#end raw
+## vim: ts=4 et list
--- /dev/null
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+set_locales_centos8() {
+
+ echo -e "\e[0Ksection_start:$( date +%s ):ks_set_locales_centos8[collapsed=true]\r\e[0KInstalling german locales ..."
+ echo
+ echo "${HASH_LINE}"
+ echo "Calling set_locales_centos8() ..."
+ echo
+
+ log "Installing german locales (langpacks-de) ..."
+ if yum install -y "langpacks-de" ; then
+ :
+ else
+ echo "[$(date)]: Could not install german locales (langpacks-de)" | tee -a "${ERROR_POINTER}"
+ fi
+
+ echo -e "\e[0Ksection_end:$( date +%s ):ks_set_locales_centos8\r\e[0K"
+}
+
+set_locales_centos8
+
+#end raw
+## vim: ts=4 et list
+++ /dev/null
-## !/bin/bash
-#raw
-
-#-----------------------------------------------------------
-set_vimrc_centos8() {
-
- echo -e "\e[0Ksection_start:$( date +%s ):ks_set_vimrc_centos8[collapsed=true]\r\e[0KGet yum repository files ..."
- 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}"
-
- echo -e "\e[0Ksection_end:$( date +%s ):ks_set_vimrc_centos8\r\e[0K"
-}
-
-set_vimrc_centos8
-
-#end raw
-## vim: ts=4 et list
--- /dev/null
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+set_vimrc_centos8() {
+
+ echo -e "\e[0Ksection_start:$( date +%s ):ks_set_vimrc_centos8[collapsed=true]\r\e[0KGet yum repository files ..."
+ 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}"
+
+ echo -e "\e[0Ksection_end:$( date +%s ):ks_set_vimrc_centos8\r\e[0K"
+}
+
+set_vimrc_centos8
+
+#end raw
+## vim: ts=4 et list
--- /dev/null
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+set_vimrc_centos8() {
+
+ echo -e "\e[0Ksection_start:$( date +%s ):ks_set_vimrc_centos8[collapsed=true]\r\e[0KGet yum repository files ..."
+ 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}"
+
+ echo -e "\e[0Ksection_end:$( date +%s ):ks_set_vimrc_centos8\r\e[0K"
+}
+
+set_vimrc_centos8
+
+#end raw
+## vim: ts=4 et list
+++ /dev/null
-## !/bin/bash
-#raw
-
-#-----------------------------------------------------------
-install_pkgs_centos8() {
-
- echo -e "\e[0Ksection_start:$( date +%s ):ks_install_pkgs_centos8[collapsed=true]\r\e[0KInstalling additional packages ..."
- echo
- echo "${HASH_LINE}"
- echo "Calling install_pkgs_centos8() ..."
- echo
- echo
- log "Installing additional packages ..."
- echo
-
- local -a pkgs_add=('colordiff' 'p7zip' 'screen' 'NetworkManager-config-server')
- local -a pkgs_remove=('nfs*' 'rpcbind')
-
- echo "Installing packages: ${pkgs_add[*]}"
- yum install -y "${pkgs_add[@]}"
-
- echo
- echo "Removing packages: ${pkgs_remove[*]}"
- yum remove -y "${pkgs_remove[@]}"
-
- echo
- echo "Creating /etc/gitconfig ..."
- cat <<-EOF >/etc/gitconfig
- [color]
- ui = true
- EOF
-
- echo -e "\e[0Ksection_end:$( date +%s ):ks_install_pkgs_centos8\r\e[0K"
-}
-
-install_pkgs_centos8
-
-#end raw
-## vim: ts=4 et list
--- /dev/null
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+install_pkgs_centos8() {
+
+ echo -e "\e[0Ksection_start:$( date +%s ):ks_install_pkgs_centos8[collapsed=true]\r\e[0KInstalling additional packages ..."
+ echo
+ echo "${HASH_LINE}"
+ echo "Calling install_pkgs_centos8() ..."
+ echo
+ echo
+ log "Installing additional packages ..."
+ echo
+
+ local -a pkgs_add=('colordiff' 'p7zip' 'screen' 'NetworkManager-config-server')
+ local -a pkgs_remove=('nfs*' 'rpcbind')
+
+ echo "Installing packages: ${pkgs_add[*]}"
+ yum install -y "${pkgs_add[@]}"
+
+ echo
+ echo "Removing packages: ${pkgs_remove[*]}"
+ yum remove -y "${pkgs_remove[@]}"
+
+ echo
+ echo "Creating /etc/gitconfig ..."
+ cat <<-EOF >/etc/gitconfig
+ [color]
+ ui = true
+ EOF
+
+ echo -e "\e[0Ksection_end:$( date +%s ):ks_install_pkgs_centos8\r\e[0K"
+}
+
+install_pkgs_centos8
+
+#end raw
+## vim: ts=4 et list
log "Upgrading all packages ..."
echo
- if yum upgrade -y ; then
+ if [[ -x /bin/dnf ]] ; then
+ YUM=dnf
+ else
+ YUM=yum
+ fi
+
+ if $YUM upgrade --assumeyes ; then
:
else
echo "[$(date)]: Upgrading system not successful." | tee -a "${ERROR_POINTER}"
cat <<-EOF >"${facter_conf_dir}/customer.yaml"
---
customer: pixelpark
+ project: unknown
EOF
echo