summaryrefslogtreecommitdiffstats
path: root/satellit_upgrader/updater.template.sh
diff options
context:
space:
mode:
authorSimon Rettberg2016-09-09 19:17:53 +0200
committerSimon Rettberg2016-09-09 19:17:53 +0200
commitd6c10ffd7edeb6367cf2ebda5131fa9d994ee7d4 (patch)
tree5e92b707bfc47e424b23d4c704ea5e9f2f372d73 /satellit_upgrader/updater.template.sh
parent[SSPS/SSUS] tmate config written (diff)
downloadsetup-scripts-d6c10ffd7edeb6367cf2ebda5131fa9d994ee7d4.tar.gz
setup-scripts-d6c10ffd7edeb6367cf2ebda5131fa9d994ee7d4.tar.xz
setup-scripts-d6c10ffd7edeb6367cf2ebda5131fa9d994ee7d4.zip
[SSUS] Fix minor issues with tmate install
Diffstat (limited to 'satellit_upgrader/updater.template.sh')
-rw-r--r--satellit_upgrader/updater.template.sh27
1 files changed, 17 insertions, 10 deletions
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