#!/bin/sh # Adds the PHP repository from DEB.SURY.ORG, see https://deb.sury.org/ # # To add this repository please do: # # curl -sSL https://packages.sury.org/php/README.txt | bash # # Everything happens in a function that is called on the last line, so a # download that breaks off halfway does not run half of the script. set -e add_repository() { if [ "$(id -u)" != "0" ]; then SUDO=sudo fi . /etc/os-release ${SUDO} apt-get update ${SUDO} apt-get -y install ca-certificates curl ${SUDO} curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb ${SUDO} dpkg -i /tmp/debsuryorg-archive-keyring.deb ${SUDO} rm -f /etc/apt/sources.list.d/php.list ${SUDO} tee /etc/apt/sources.list.d/php.sources > /dev/null <