1
0
mirror of https://github.com/azlux/log2ram.git synced 2023-10-10 13:37:24 +02:00
log2ram/install.sh

25 lines
810 B
Bash
Raw Normal View History

#!/usr/bin/env sh
2016-04-18 12:07:33 +02:00
systemctl -q is-active log2ram && { echo "ERROR: log2ram service is still running. Please run \"sudo service log2ram stop\" to stop it."; exit 1; }
2018-04-22 21:16:23 +02:00
[ "$(id -u)" -eq 0 ] || { echo "You need to be ROOT (sudo can be used)"; exit 1; }
2018-04-22 21:16:23 +02:00
# log2ram
mkdir -p /usr/local/bin/
install -m 644 log2ram.service /etc/systemd/system/log2ram.service
install -m 755 log2ram /usr/local/bin/log2ram
install -m 644 log2ram.conf /etc/log2ram.conf
install -m 644 uninstall.sh /usr/local/bin/uninstall-log2ram.sh
systemctl enable log2ram
2018-04-22 21:16:23 +02:00
# cron
install -m 755 log2ram.hourly /etc/cron.hourly/log2ram
install -m 644 log2ram.logrotate /etc/logrotate.d/log2ram
2018-04-22 21:16:23 +02:00
# Remove a previous log2ram version
rm -rf /var/log.hdd
2018-04-22 21:16:23 +02:00
# Make sure we start clean
rm -rf /var/hdd.log
2018-04-22 21:16:23 +02:00
echo "##### Reboot to activate log2ram #####"