From 7cc6197f74e97cb522894046718712cd03d3d385 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 3 Jul 2019 11:57:56 -0400 Subject: [PATCH] minor fix and add automatic updates --- distro-end | 17 ++++++++++++++++- .../usr/local/bin/zelous-unattended-reboot | 16 ++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100755 filesystem/usr/local/bin/zelous-unattended-reboot diff --git a/distro-end b/distro-end index b542858..91c7a83 100755 --- a/distro-end +++ b/distro-end @@ -181,6 +181,18 @@ sgo certbotmail.timer pi ${p1[@]} +##### begin automatic upgrades #### +# this makes it so we upgrade everything +debconf-set-selections <<'EOF' +unattended-upgrades unattended-upgrades/origins_pattern string "codename=${distro_codename}"; +EOF +dpkg-reconfigure -u -fnoninteractive unattended-upgrades + +# Setup daily reboots, so all unattended upgrades go into affect +# unattended upgrades happen at 6 am + rand(60 min). +echo '20 7 * * * root /usr/local/bin/zelous-unattended-reboot' >/etc/cron.d/unattended-upgrade-reboot +##### end automatic upgrades #### + ## prometheus node exporter setup web-conf -f 9100 -p 9101 apache2 $(hostname -f) <<'EOF' @@ -1306,8 +1318,11 @@ EOF rpc_pass=$(

/dev/null; then + /sbin/reboot + exit 0 + fi + echo "pid $PID. unattended upgrade reboot waiting 10 seconds for dpkg lock" | wall + sleep 10 + done + echo "dpkg locked for 5 minutes, automatic reboot failed" | pee cat wall +fi -- 2.30.2