Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

32 lignes
1.2 KiB

  1. #!/usr/bin/env sh
  2. systemctl -q is-active log2ram && { echo "ERROR: log2ram service is still running. Please run \"sudo service log2ram stop\" to stop it."; exit 1; }
  3. [ "$(id -u)" -eq 0 ] || { echo "You need to be ROOT (sudo can be used)"; exit 1; }
  4. # log2ram
  5. mkdir -p /usr/local/bin/
  6. install -m 644 log2ram.service /etc/systemd/system/log2ram.service
  7. install -m 644 log2ram-daily.service /etc/systemd/system/log2ram-daily.service
  8. install -m 644 log2ram-daily.timer /etc/systemd/system/log2ram-daily.timer
  9. install -m 755 log2ram /usr/local/bin/log2ram
  10. install -m 644 log2ram.conf /etc/log2ram.conf
  11. install -m 644 uninstall.sh /usr/local/bin/uninstall-log2ram.sh
  12. systemctl enable log2ram.service log2ram-daily.timer
  13. # logrotate
  14. if [ -d /etc/logrotate.d ]; then
  15. install -m 644 log2ram.logrotate /etc/logrotate.d/log2ram
  16. else
  17. echo "##### Directory /etc/logrotate.d does not exist. #####"
  18. echo "##### Skipping log2ram.logrotate installation. #####"
  19. fi
  20. # Remove a previous log2ram version
  21. rm -rf /var/log.hdd
  22. # Make sure we start clean
  23. rm -rf /var/hdd.log
  24. echo "##### Reboot to activate log2ram #####"
  25. echo "##### edit /etc/log2ram.conf to configure options ####"