Avoid "cp cannot stat" issue by moving wildcard outside the variable.

This commit is contained in:
Jeremy Gardais 2018-01-30 17:55:49 +01:00
parent 203f3bb27f
commit 96b74ca2d9
2 changed files with 6 additions and 6 deletions

Binary file not shown.

View File

@ -1,22 +1,22 @@
#!/bin/sh #!/bin/sh
APT_CONF_INCLUDE_SRC="$(dirname $0)/stretch/etc/apt/apt.conf.d/*" APT_CONF_INCLUDE_SRC="$(dirname $0)/stretch/etc/apt/apt.conf.d/"
APT_CONF_INCLUDE_PATH="/etc/apt/apt.conf.d/" APT_CONF_INCLUDE_PATH="/etc/apt/apt.conf.d/"
RSYSLOGD_CONF_SRC="$(dirname $0)/stretch/etc/rsyslog.conf" RSYSLOGD_CONF_SRC="$(dirname $0)/stretch/etc/rsyslog.conf"
RSYSLOGD_CONF_PATH="/etc/rsyslog.conf" RSYSLOGD_CONF_PATH="/etc/rsyslog.conf"
RSYSLOGD_INCLUDE_SRC="$(dirname $0)/stretch/etc/rsyslog.d/*" RSYSLOGD_INCLUDE_SRC="$(dirname $0)/stretch/etc/rsyslog.d/"
RSYSLOGD_INCLUDE_PATH="/etc/rsyslog.d/" RSYSLOGD_INCLUDE_PATH="/etc/rsyslog.d/"
LOGROTATE_CONF_SRC="$(dirname $0)/stretch/etc/logrotate.conf" LOGROTATE_CONF_SRC="$(dirname $0)/stretch/etc/logrotate.conf"
LOGROTATE_CONF_PATH="/etc/logrotate.conf" LOGROTATE_CONF_PATH="/etc/logrotate.conf"
LOGROTATE_INCLUDE_SRC="$(dirname $0)/stretch/etc/logrotate.d/*" LOGROTATE_INCLUDE_SRC="$(dirname $0)/stretch/etc/logrotate.d/"
LOGROTATE_INCLUDE_PATH="/etc/logrotate.d/" LOGROTATE_INCLUDE_PATH="/etc/logrotate.d/"
# apt configuration {{{ # apt configuration {{{
# ensure to have some default configuration for Apt # ensure to have some default configuration for Apt
cp -- "${APT_CONF_INCLUDE_SRC}" "${APT_CONF_INCLUDE_PATH}" cp -- "${APT_CONF_INCLUDE_SRC}"* "${APT_CONF_INCLUDE_PATH}"
# }}} # }}}
@ -84,7 +84,7 @@ fi
if [ -f "${RSYSLOGD_CONF_PATH}" ]; then if [ -f "${RSYSLOGD_CONF_PATH}" ]; then
cp "${RSYSLOGD_CONF_SRC}" "${RSYSLOGD_CONF_PATH}" cp "${RSYSLOGD_CONF_SRC}" "${RSYSLOGD_CONF_PATH}"
fi fi
cp -- "${RSYSLOGD_INCLUDE_SRC}" "${RSYSLOGD_INCLUDE_PATH}" cp -- "${RSYSLOGD_INCLUDE_SRC}"* "${RSYSLOGD_INCLUDE_PATH}"
# Restart Rsyslog service # Restart Rsyslog service
systemctl restart rsyslog systemctl restart rsyslog
@ -97,7 +97,7 @@ systemctl restart rsyslog
if [ -f "${LOGROTATE_CONF_PATH}" ]; then if [ -f "${LOGROTATE_CONF_PATH}" ]; then
cp "${LOGROTATE_CONF_SRC}" "${LOGROTATE_CONF_PATH}" cp "${LOGROTATE_CONF_SRC}" "${LOGROTATE_CONF_PATH}"
fi fi
cp -- "${LOGROTATE_INCLUDE_SRC}" "${LOGROTATE_INCLUDE_PATH}" cp -- "${LOGROTATE_INCLUDE_SRC}"* "${LOGROTATE_INCLUDE_PATH}"
# Create an archive directory for some log files (aptitude, dpkg,…) # Create an archive directory for some log files (aptitude, dpkg,…)
mkdir -p -- /var/log/old_logs.d /var/log/aptitude.d /var/log/dpkg.d /var/log/alternatives.d /var/log/syslog.d /var/log/cron.d /var/log/daemon.d /var/log/kern.d /var/log/lpr.d /var/log/mail.d /var/log/auth.d /var/log/messages.d mkdir -p -- /var/log/old_logs.d /var/log/aptitude.d /var/log/dpkg.d /var/log/alternatives.d /var/log/syslog.d /var/log/cron.d /var/log/daemon.d /var/log/kern.d /var/log/lpr.d /var/log/mail.d /var/log/auth.d /var/log/messages.d