From b237c6e22e716f6cc2b12f61d9350825d9d20d49 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 14 Feb 2019 13:42:16 +0100 Subject: [SSUS] Fix tmate install to check for distro version --- satellit_upgrader/pack-update.sh | 1 - satellit_upgrader/updater.template.sh | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/satellit_upgrader/pack-update.sh b/satellit_upgrader/pack-update.sh index dc4112c..126e441 100755 --- a/satellit_upgrader/pack-update.sh +++ b/satellit_upgrader/pack-update.sh @@ -29,7 +29,6 @@ declare -rg TGZ_TASKMANAGER="files/taskmanager.tar.gz" declare -rg TGZ_TFTP="files/tftpdir.tar.gz" declare -rg TGZ_IPXE="files/ipxe.tar.gz" - declare -rg FILES_IPXE=" pxelinux.0 src/ diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 052de70..771ad3e 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -604,12 +604,18 @@ if [ -n "$TGZ_LDADP" ]; then fi # ************************** tmate ************************ -if ! which tmate > /dev/null 2>&1; then +if [ "$( lsb_release -cs )" != "jessie" ]; then + # Kill this file; was accidentally put there on stretch + rm -f -- "/etc/apt/sources.list.d/10-added_repos.list" +fi +if ! which tmate &> /dev/null; then echo "* Installing tmate" - echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/10-added_repos.list - echo "Running apt update..." - if ! failprint apt-get update; then - pwarning "Adding backports repo: update failed" + if [ "$( lsb_release -cs )" = "jessie" ]; then + echo "deb http://ftp.debian.org/debian jessie-backports main" > "/etc/apt/sources.list.d/10-added_repos.list" + echo "Running apt update..." + if ! failprint apt-get update; then + pwarning "Adding backports repo: update failed" + fi fi echo "Installing package..." if ! failprint apt-get install -y tmate; then @@ -625,7 +631,7 @@ if ! which tmate > /dev/null 2>&1; then set -g tmate-identity "" JUSTANOTHERDOC - if which tmate > /dev/null 2>&1; then + if which tmate &> /dev/null; then echo "tmate installation complete!" fi fi -- cgit v1.2.3-55-g7522