Clean Jessie's late_command script config files

This commit is contained in:
Jeremy Gardais 2019-01-24 17:26:54 +01:00
parent 2d9e48c0ba
commit 96d1db0a87
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
8 changed files with 16 additions and 20 deletions

Binary file not shown.

View File

@ -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