From d6c10ffd7edeb6367cf2ebda5131fa9d994ee7d4 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 9 Sep 2016 19:17:53 +0200 Subject: [SSUS] Fix minor issues with tmate install --- satellit_upgrader/updater.template.sh | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'satellit_upgrader/updater.template.sh') diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 85e87a2..93e6067 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -337,15 +337,18 @@ if [ -n "$TGZ_LDADP" ]; then fi # ************************** tmate ************************ - -echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/10-added_repos.list -apt-get update || pwarning "Adding backborts repo: update failed" && \ - echo "Repository backports added." -apt-get install tmate || pwarning "Could not install tmate. Please check whether repo backports was added and install by hand." && \ - echo "tmate istalled." - -write_tmate_config() { - [ -d /root/.tmate.conf ] && mv /root/.tmate.conf.old +if ! which tmate > /dev/null 2>&1; then + echo "* tmate" + echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/10-added_repos.list + if ! apt-get update > "$TMPDIR/apt.log" 2>&1; then + cat "$TMPDIR/apt.log" + pwarning "Adding backborts repo: update failed" + fi + if ! apt-get install -y tmate > "$TMPDIR/apt.log" 2>&1; then + cat "$TMPDIR/apt.log" + pwarning "Could not install tmate. Easy remote assistance will not be available." + pwarning "Please check whether repo 'jessie-backports' was added and install by hand." + fi cat > /root/.tmate.conf <<-JUSTANOTHERDOC set -g tmate-server-host "tmate.ruf.uni-freiburg.de" set -g tmate-server-port 2222 @@ -353,7 +356,11 @@ write_tmate_config() { set -g tmate-server-ecdsa-fingerprint "4f:c9:81:f1:1a:20:7d:6f:97:12:f2:a9:0f:f4:c5:6c" set -g tmate-identity "" JUSTANOTHERDOC -} + + if which tmate > /dev/null 2>&1; then + echo "tmate installation complete" + fi +fi # ************************ sudo config ********************* if [ -n "$FILEDIR/tm-sudo-config" ]; then -- cgit v1.2.3-55-g7522