#!/usr/bin/env bash ##################################################################### # 2ndQuadrant APT repository: installation shell script # # Repository: dl/default/release at 2ndquadrant.com # # Copyright (C) 2018-2020 2ndQuadrant (www.2ndQuadrant.com) ##################################################################### set -eEu INSTALLATION_REPORT="$(mktemp -t 2ndq_packages_installation.log.XXXXX)" # The installation script is wrapped in the "do_install()" function # for two reasons: # 1. protect against partial download of the file (and subsequent # execution - e.g. "curl ... | sh") # 2. redirect stderr channel to a temporary file # some protection against only getting part of the file during the do_install() { # Enable trace inside the function set -x # Default connection timeout = 30 seconds. # You can override it with the SECONDQ_TIMEOUT environment variable. # For example, you can set it to 10 seconds as follows: # export SECONDQ_TIMEOUT = 10 SECONDQ_TIMEOUT=${SECONDQ_TIMEOUT:-30} # Check distribution compatibility if [ ! -d /etc/apt/sources.list.d/ ] then echo "Cannot install APT packages: incompatible distribution" return fi # # Install the repository public GPG key # apt-key add - < "$source_list_file" < "${INSTALLATION_REPORT}" rm -f "${INSTALLATION_REPORT}" # End of repository installation script ;)