From 8186a62166e8a40fe91d7bacae0ea6583adae793 Mon Sep 17 00:00:00 2001 From: yodax Date: Wed, 3 May 2017 11:21:09 +0200 Subject: [PATCH] Add unattended upgrades for php7 --- setup/functions.sh | 9 +++++++++ setup/owncloud.sh | 1 + 2 files changed, 10 insertions(+) diff --git a/setup/functions.sh b/setup/functions.sh index 947aa5ab..00cc4d90 100644 --- a/setup/functions.sh +++ b/setup/functions.sh @@ -48,6 +48,15 @@ function apt_install { apt_get_quiet install $PACKAGES } +function apt_add_repository_to_unattended_upgrades { + if [ -f /etc/apt/apt.conf.d/50unattended-upgrades ]; then + if ! grep -q "$1" /etc/apt/apt.conf.d/50unattended-upgrades; then + sed -i "/Allowed-Origins/a \ + \"$1\";" /etc/apt/apt.conf.d/50unattended-upgrades + fi + fi +} + function get_default_hostname { # Guess the machine's hostname. It should be a fully qualified # domain name suitable for DNS. None of these calls may provide diff --git a/setup/owncloud.sh b/setup/owncloud.sh index 75523441..7fa92418 100755 --- a/setup/owncloud.sh +++ b/setup/owncloud.sh @@ -18,6 +18,7 @@ apt-get purge -qq -y owncloud* # Install php-7 from the ppa of the ubuntu php maintainer Ondřej Surý located here https://launchpad.net/%7Eondrej/+archive/ubuntu/php hide_output add-apt-repository -y ppa:ondrej/php +apt_add_repository_to_unattended_upgrades LP-PPA-ondrej-php:trusty hide_output apt-get update apt_install php7.0 php7.0-fpm \ php7.0-cli php7.0-sqlite php7.0-gd php7.0-imap php7.0-curl php-pear php-apc curl \