Silence errors when logrotate is not installed

Co-authored-by: emwe1 <emwe1@users.noreply.github.com>
This commit is contained in:
Samuel FORESTIER 2020-07-22 20:40:02 +00:00
parent a5c7f553df
commit 0fdf8827e5
2 changed files with 7 additions and 2 deletions

View File

@ -14,7 +14,12 @@ install -m 644 uninstall.sh /usr/local/bin/uninstall-log2ram.sh
systemctl enable log2ram.service log2ram-daily.timer
# logrotate
install -m 644 log2ram.logrotate /etc/logrotate.d/log2ram
if [ -d /etc/logrotate.d ]; then
install -m 644 log2ram.logrotate /etc/logrotate.d/log2ram
else
echo "##### Directory /etc/logrotate.d does not exist. #####"
echo "##### Skipping log2ram.logrotate installation. #####"
fi
# Remove a previous log2ram version
rm -rf /var/log.hdd

View File

@ -13,7 +13,7 @@ then
rm -rf /etc/systemd/system/log2ram*
rm /usr/local/bin/log2ram
rm /etc/log2ram.conf
rm /etc/logrotate.d/log2ram
rm -f /etc/logrotate.d/log2ram
if [ -d /var/hdd.log ]; then
rm -r /var/hdd.log