if [[ -s "${tmp_file}" ]] ; then
cat "${tmp_file}" >> /root/.ssh/authorized_keys
fi
- rm "${tmp_file}"
+ rm -v "${tmp_file}"
}
#-----------------------------------------------------------
}
+#-----------------------------------------------------------
+config_logrotate() {
+
+ echo
+ echo "${HASH_LINE}"
+ echo
+ log "Configuring logrotation ..."
+ echo
+
+ mkdir -pv /etc/logrotate.d
+
+ local base_url="${COBBLER_URL}/custom/create-vmware-tpl/files"
+
+ local tmp_file=$( mktemp )
+ local url="${base_url}/logrotate.conf"
+ 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 [[ -s "${tmp_file}" ]] ; then
+ cp -v "${tmp_file}" "${tgt}"
+ fi
+
+ local base=
+ for base in btmp syslog wtmp ; do
+ url="${base_url}/logrotate.d.${base}"
+ 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 [[ -s "${tmp_file}" ]] ; then
+ cp -v "${tmp_file}" "${tgt}"
+ fi
+ done
+
+ rm -v "${tmp_file}"
+
+}
+
#-----------------------------------------------------------
main() {
install_clamav
install_puppet
install_postfix
+ config_logrotate
config_rsyslog_to_remote
remove_ipv6_localhost