autoupdate.sh 1.0 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. echo '\033[35m
  3. ___ __ __ __ __ __
  4. / | __ __/ /_____ / / / /___ ____/ /___ _/ /____
  5. / /| |/ / / / __/ __ \ / / / / __ \/ __ / __ `/ __/ _ \
  6. / ___ / /_/ / /_/ /_/ / / /_/ / /_/ / /_/ / /_/ / /_/ __/
  7. /_/ |_\__,_/\__/\____/ \____/ .___/\__,_/\__,_/\__/\___/
  8. /_/
  9. \033[0m'
  10. # https://www.howtoforge.com/how-to-configure-automatic-updates-on-debian-wheezy
  11. # https://www.bisolweb.com/tutoriels/serveur-vps-ovh-partie-5-installation-apticron/
  12. if [ "$EUID" -ne 0 ]; then
  13. echo "Please run as root"
  14. exit
  15. fi
  16. echo "\033[35;1mInstalling apticron \033[0m"
  17. apt-get --yes --force-yes install apticron
  18. sleep 3
  19. echo -n "Enter an email: "
  20. read email
  21. sed -ir "s/EMAIL=\"root\"/EMAIL=\"$email\"/g" /etc/apticron/apticron.conf
  22. # sed -ir "s/# DIFF_ONLY=\"1\"/DIFF_ONLY=\"1\"/g" /etc/apticron/apticron.conf
  23. sed -ir "s/# NOTIFY_NEW=\"0\"/NOTIFY_NEW=\"0\"/g" /etc/apticron/apticron.conf
  24. echo "\033[92;1mApticron installed and configured\033[0m"