Skip to content

Commit

Permalink
fix unattended-upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Aug 10, 2017
1 parent 00a483a commit 8127734
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions etc/nextcloudpi-config.d/unattended-upgrades.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,20 @@ configure()
{
[[ $ACTIVE_ == "yes" ]] && local AUTOUPGRADE=1 || local AUTOUPGRADE=0
[[ $AUTOREBOOT_ == "yes" ]] && local AUTOREBOOT=true || local AUTOREBOOT=false

# It seems like the label Raspbian-Security does not work for Raspbian
# See https://www.raspberrypi.org/forums/viewtopic.php?t=82863&p=585739
cat > /etc/apt/apt.conf.d/20nextcloudpi-upgrades <<EOF
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "$AUTOUPGRADE";
APT::Periodic::MaxAge "14";
APT::Periodic::AutocleanInterval "7";
Unattended-Upgrade::Automatic-Reboot "$AUTOREBOOT";
Unattended-Upgrade::Automatic-Reboot-Time "04:00";
Unattended-Upgrade::Origins-Pattern {
o=Raspbian,n=jessie,l=Raspbian;
o=Raspbian,n=stretch,l=Raspbian;
}
EOF
echo "Unattended upgrades active: $ACTIVE_ (autoreboot $AUTOREBOOT_)"
}
Expand Down
4 changes: 4 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ cp -r ncp-web /var/www/
chown www-data:www-data /var/www/ncp-web
chmod 770 /var/www/ncp-web

# force-fix unattended-upgrades for old image users
cd /usr/local/etc/nextcloudpi-config.d/
activate_script unattended-upgrades.sh

# License
#
# This script is free software; you can redistribute it and/or modify it
Expand Down

0 comments on commit 8127734

Please sign in to comment.