echo "Using snippet $postfix_snippet"
$SNIPPET($postfix_snippet)
+#set $logrotate_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.500.logrotate.sh"
+echo
+echo "Using snippet $logrotate_snippet"
+$SNIPPET($logrotate_snippet)
-
+## ###########################
+## Sees to be finished
#set $finish_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.999.finish.sh"
echo
--- /dev/null
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+config_logrotate() {
+
+ echo
+ echo "${HASH_LINE}"
+ echo "Calling config_logrotate() ..."
+ echo
+ local base_url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}"
+
+ log "Configuring logrotation ..."
+ echo
+
+ mkdir -pv /etc/logrotate.d
+
+ local tmp_file=$( mktemp )
+ local url="${base_url}/logrotate.conf"
+ local tgt="/etc/logrotate.conf"
+
+ echo "Getting ${url} => ${tgt} ..."
+ 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
+
+ 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} ..."
+ 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
+ done
+
+ rm -v "${tmp_file}"
+ echo "Finished logrotate configuration."
+
+}
+
+config_logrotate
+
+#end raw
+## vim: ts=4 et list