diff --git a/scripts/latecommand.tar.gz b/scripts/latecommand.tar.gz index b4321a2..a47d62e 100644 Binary files a/scripts/latecommand.tar.gz and b/scripts/latecommand.tar.gz differ diff --git a/scripts/latecommand/logrotate.jessie/logrotate.conf b/scripts/latecommand/jessie/etc/logrotate.conf similarity index 100% rename from scripts/latecommand/logrotate.jessie/logrotate.conf rename to scripts/latecommand/jessie/etc/logrotate.conf diff --git a/scripts/latecommand/logrotate.jessie/aptitude b/scripts/latecommand/jessie/etc/logrotate.d/aptitude similarity index 100% rename from scripts/latecommand/logrotate.jessie/aptitude rename to scripts/latecommand/jessie/etc/logrotate.d/aptitude diff --git a/scripts/latecommand/logrotate.jessie/dpkg b/scripts/latecommand/jessie/etc/logrotate.d/dpkg similarity index 100% rename from scripts/latecommand/logrotate.jessie/dpkg rename to scripts/latecommand/jessie/etc/logrotate.d/dpkg diff --git a/scripts/latecommand/logrotate.jessie/rsyslog b/scripts/latecommand/jessie/etc/logrotate.d/rsyslog similarity index 100% rename from scripts/latecommand/logrotate.jessie/rsyslog rename to scripts/latecommand/jessie/etc/logrotate.d/rsyslog diff --git a/scripts/latecommand/rsyslog.jessie/rsyslog.conf b/scripts/latecommand/jessie/etc/rsyslog.conf similarity index 100% rename from scripts/latecommand/rsyslog.jessie/rsyslog.conf rename to scripts/latecommand/jessie/etc/rsyslog.conf diff --git a/scripts/latecommand/rsyslog.jessie/99syslog.conf b/scripts/latecommand/jessie/etc/rsyslog.d/99syslog.conf similarity index 100% rename from scripts/latecommand/rsyslog.jessie/99syslog.conf rename to scripts/latecommand/jessie/etc/rsyslog.d/99syslog.conf diff --git a/scripts/latecommand/post.jessie.sh b/scripts/latecommand/post.jessie.sh index 18c6dad..6682798 100755 --- a/scripts/latecommand/post.jessie.sh +++ b/scripts/latecommand/post.jessie.sh @@ -1,18 +1,14 @@ #!/bin/sh -RSYSLOGD_CONF="$(dirname $0)/rsyslog.jessie/rsyslog.conf" -RSYSLOGD_FILE="/etc/rsyslog.conf" -RSYSLOGD_SYSLOG_CONF="$(dirname $0)/rsyslog.jessie/99syslog.conf" -RSYSLOGD_SYSLOG_FILE="/etc/rsyslog.d/99syslog.conf" +RSYSLOGD_CONF_SRC="$(dirname $0)/jessie/etc/rsyslog.conf" +RSYSLOGD_CONF_PATH="/etc/rsyslog.conf" +RSYSLOGD_INCLUDE_SRC="$(dirname $0)/jessie/etc/rsyslog.d/" +RSYSLOGD_INCLUDE_PATH="/etc/rsyslog.d/" -LOGROTATE_CONF="$(dirname $0)/logrotate.jessie/logrotate.conf" -LOGROTATE_FILE="/etc/logrotate.conf" -LOGROTATE_SYSLOG_CONF="$(dirname $0)/logrotate.jessie/rsyslog" -LOGROTATE_SYSLOG_FILE="/etc/logrotate.d/rsyslog" -LOGROTATE_APTITUDE_CONF="$(dirname $0)/logrotate.jessie/aptitude" -LOGROTATE_APTITUDE_FILE="/etc/logrotate.d/aptitude" -LOGROTATE_DPKG_CONF="$(dirname $0)/logrotate.jessie/dpkg" -LOGROTATE_DPKG_FILE="/etc/logrotate.d/dpkg" +LOGROTATE_CONF_SRC="$(dirname $0)/jessie/etc/logrotate.conf" +LOGROTATE_CONF_PATH="/etc/logrotate.conf" +LOGROTATE_INCLUDE_SRC="$(dirname $0)/jessie/etc/logrotate.d/" +LOGROTATE_INCLUDE_PATH="/etc/logrotate.d/" ## Packages {{{ # Ensure to have some basic packages @@ -46,10 +42,11 @@ aptitude -y install openssh-server openssh-sftp-server ### Rsyslog {{{ # Install new Rsyslog configuration -if [ -f "${RSYSLOGD_FILE}" ]; then - cp "${RSYSLOGD_CONF}" "${RSYSLOGD_FILE}" +if [ -f "${RSYSLOGD_CONF_PATH}" ]; then + cp -- "${RSYSLOGD_CONF_PATH}" "${RSYSLOGD_CONF_PATH}".orig + cp -- "${RSYSLOGD_CONF_SRC}" "${RSYSLOGD_CONF_PATH}" fi -cp "${RSYSLOGD_SYSLOG_CONF}" "${RSYSLOGD_SYSLOG_FILE}" +cp -- "${RSYSLOGD_INCLUDE_SRC}"* "${RSYSLOGD_INCLUDE_PATH}" # Remove old log files ## Kernel log files @@ -69,12 +66,11 @@ rm -f /var/log/daemon.log /var/log/syslog /var/log/messages ### Logrotate {{{ # Install new Logrotate configuration -if [ -f "${LOGROTATE_FILE}" ]; then - cp "${LOGROTATE_CONF}" "${LOGROTATE_FILE}" +if [ -f "${LOGROTATE_CONF_PATH}" ]; then + cp -- "${LOGROTATE_CONF_PATH}" "${LOGROTATE_CONF_PATH}".orig + cp -- "${LOGROTATE_CONF_SRC}" "${LOGROTATE_CONF_PATH}" fi -cp "${LOGROTATE_SYSLOG_CONF}" "${LOGROTATE_SYSLOG_FILE}" -cp "${LOGROTATE_APTITUDE_CONF}" "${LOGROTATE_APTITUDE_FILE}" -cp "${LOGROTATE_DPKG_CONF}" "${LOGROTATE_DPKG_FILE}" +cp -- "${LOGROTATE_INCLUDE_SRC}"* "${LOGROTATE_INCLUDE_PATH}" # Create an archive directory for some log files (aptitude, dpkg,…) mkdir -p -- /var/log/old_logs