POSTFIX_MYORIGIN='pixelpark.net'
POSTFIX_RELAYHOST='[mx.pixelpark.net]'
+ERROR_POINTER="/root/postinst-error.txt"
+
echo
echo "Some information:"
echo " \$hostname: $hostname"
tgt="/etc/yum.repos.d/${bname}"
echo
echo "Retrieving '${url}' -> '${tgt}' ..."
- wget -O "${tgt}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true
+ if wget -O "${tgt}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" ; then
+ :
+ else
+ echo "[$(date)]: Could not get '${bname}' from '${url}'." | tee -a "${ERROR_POINTER}"
+ fi
chmod -v 0644 "${tgt}"
done
tgt="/etc/pki/rpm-gpg/${bname}"
echo
echo "Retrieving '${url}' -> '${tgt}' ..."
- wget -O "${tgt}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true
+ if wget -O "${tgt}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" ; then
+ :
+ else
+ echo "[$(date)]: Could not get '${bname}' from '${url}'." | tee -a "${ERROR_POINTER}"
+ fi
chmod -v 0644 "${tgt}"
done
echo
log "Updating YUM cache ..."
- yum makecache fast
+ if yum makecache fast ; then
+ :
+ else
+ echo "[$(date)]: Could not update YUM cache." | tee -a "${ERROR_POINTER}"
+ fi
echo
log "Installing perl-Config-IniFiles.noarch ..."
- yum install -y perl-Config-IniFiles.noarch
+ if yum install -y perl-Config-IniFiles.noarch ; then
+ :
+ else
+ echo "[$(date)]: Could not install perl-Config-IniFiles.noarch." | tee -a "${ERROR_POINTER}"
+ fi
sleep 3
}
local local_tar=$( mktemp -p /tmp "linux_tcsh.XXXXXXXX.tar" )
echo "Local tar file: '${local_tar}'."
- wget -O "${local_tar}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true
+ if wget -O "${local_tar}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" ; then
+ :
+ else
+ echo "[$(date)]: Could not get 'linux_tcsh.tar' from '${url}'." | tee -a "${ERROR_POINTER}"
+ fi
if [[ -f "${local_tar}" && -s "${local_tar}" ]] ; then
cd /etc
echo "Unpacking '${local_tar}' ..."
url="${COBBLER_URL}/custom/create-vmware-tpl/files/fbr.sh"
local tgt="/etc/profile.d/fbr.sh"
echo "Retrieving '${url}' -> '${tgt}' ..."
- wget -O "${tgt}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true
+ if wget -O "${tgt}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}"; then
+ :
+ else
+ echo "[$(date)]: Could not get 'fbr.sh' from '${url}'." | tee -a "${ERROR_POINTER}"
+ fi
chmod -v 0644 "${tgt}"
}
echo "${HASH_LINE}"
echo
log "Installing NetworkManager ..."
- yum install -y NetworkManager NetworkManager-config-server NetworkManager-tui
+ if yum install -y NetworkManager NetworkManager-config-server NetworkManager-tui ; then
+ :
+ else
+ echo "[$(date)]: Could not install NetworkManager." | tee -a "${ERROR_POINTER}"
+ fi
echo "Enabling NetworkManager ..."
systemctl enable NetworkManager
echo
log "Installng VLAN vconfig ..."
- yum install -y vconfig
-
+ if yum install -y vconfig ; then
+ :
+ else
+ echo "[$(date)]: Could not install vconfig." | tee -a "${ERROR_POINTER}"
+ fi
echo
log "Installing packages: ${misc_pkgs}"
- yum install -y ${misc_pkgs}
+ if yum install -y ${misc_pkgs} ; then
+ :
+ else
+ echo "[$(date)]: Could not install ${misc_pkgs}" | tee -a "${ERROR_POINTER}"
+ fi
echo
log "Removing packages mysql-community* ..."
echo
log "Creating initial /etc/motd ..."
local mk_script=$( mktemp -p /tmp "mk_create_motd.XXXXXXXXXX.ksh" )
- wget -O "${mk_script}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}"
- chmod 0755 "${mk_script}"
- "${mk_script}" -i 192.168.88.0/23 \
- -p "Template VM" \
- -l "L105 VMWare" \
- -o "Pixelpark GmbH" > /etc/motd
+ if wget -O "${mk_script}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" ; then
+ chmod 0755 "${mk_script}"
+ "${mk_script}" -i 192.168.88.0/23 \
+ -p "Template VM" \
+ -l "L105 VMWare" \
+ -o "Pixelpark GmbH" > /etc/motd
+ else
+ echo "[$(date)]: Could not get 'mk_create_motd.ksh' from '${url}'." | tee -a "${ERROR_POINTER}"
+ fi
rm -fv "${mk_script}"
}
log "Installing Legato networker client ..."
echo "Installing from URL '${url_client}' ..."
- yum install -y "${url_client}"
+ if yum install -y "${url_client}" ; then
+ :
+ else
+ echo "[$(date)]: Could not install from ${url_client}" | tee -a "${ERROR_POINTER}"
+ fi
echo "Installing from URL '${url_man}' ..."
- yum install -y "${url_man}"
+ if yum install -y "${url_man}" ; then
+ :
+ else
+ echo "[$(date)]: Could not install from ${url_man}" | tee -a "${ERROR_POINTER}"
+ fi
mkdir -pv /nsr/res
echo "legato01.pixelpark.com" > /nsr/res/servers
echo
log "Installing NTP ..."
- yum install -y ntp
+ if yum install -y ntp ; then
+ :
+ else
+ echo "[$(date)]: Could not install ntp." | tee -a "${ERROR_POINTER}"
+ fi
echo "Cofiguring ntpd ..."
mkdir -pv /etc/ntp
echo
log "Installing open-vm-tools ..."
- yum install -y open-vm-tools
+ if yum install -y open-vm-tools ; then
- echo "Enabling vmware-tools and vmtoolsd ..."
- systemctl enable vmware-tools
- systemctl enable vmtoolsd
+ echo "Enabling vmware-tools and vmtoolsd ..."
+ systemctl enable vmware-tools
+ systemctl enable vmtoolsd
- vmware-toolbox-cmd timesync disable
+ vmware-toolbox-cmd timesync disable
+
+ else
+ echo "[$(date)]: Could not install open-vm-tools" | tee -a "${ERROR_POINTER}"
+ fi
}
echo
log "Upgrading all packages ..."
echo
- yum upgrade -y
+ if yum upgrade -y ; then
+ :
+ else
+ echo "[$(date)]: Upgrading system not successful." | tee -a "${ERROR_POINTER}"
+ fi
}
echo
echo "Installing puppet package ..."
- yum install -y puppet-agent
+ if yum install -y puppet-agent ; then
+ :
+ else
+ echo "[$(date)]: Could not install puppet-agent." | tee -a "${ERROR_POINTER}"
+ fi
echo
echo "Creating config dirs ..."
)
- yum install -y postfix mailx
+ if yum install -y postfix mailx ; then
+ :
+ else
+ echo "[$(date)]: Could not install postfix and mailx." | tee -a "${ERROR_POINTER}"
+ fi
cat <<-EOF >"/etc/postfix/generic"
local tgt="/etc/logrotate.conf"
echo "Getting ${url} => ${tgt} ..."
- wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true
+ if wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" ; then
+ :
+ else
+ echo "[$(date)]: Could not get 'logrotate.conf' from '${url}'." | tee -a "${ERROR_POINTER}"
+ fi
if [[ -s "${tmp_file}" ]] ; then
cp -v "${tmp_file}" "${tgt}"
fi
tgt="/etc/logrotate.d/${base}"
cp -v /dev/null "${tmp_file}"
echo "Getting ${url} => ${tgt} ..."
- wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true
+ if wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" ; then
+ :
+ else
+ echo "[$(date)]: Could not get '${base}' from '${url}'." | tee -a "${ERROR_POINTER}"
+ fi
if [[ -s "${tmp_file}" ]] ; then
cp -v "${tmp_file}" "${tgt}"
fi
tweak_grub
+ echo "[$(date)]: Test error." | tee -a "${ERROR_POINTER}"
+
}