No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

34 líneas
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. if [ ! -f filename ]; then
  11. install -m 644 log2ram.conf /etc/log2ram.conf
  12. fi
  13. install -m 644 uninstall.sh /usr/local/bin/uninstall-log2ram.sh
  14. systemctl enable log2ram.service log2ram-daily.timer
  15. # logrotate
  16. if [ -d /etc/logrotate.d ]; then
  17. install -m 644 log2ram.logrotate /etc/logrotate.d/log2ram
  18. else
  19. echo "##### Directory /etc/logrotate.d does not exist. #####"
  20. echo "##### Skipping log2ram.logrotate installation. #####"
  21. fi
  22. # Remove a previous log2ram version
  23. rm -rf /var/log.hdd
  24. # Make sure we start clean
  25. rm -rf /var/hdd.log
  26. echo "##### Reboot to activate log2ram #####"
  27. echo "##### edit /etc/log2ram.conf to configure options ####"