From b8f9d34d79c1216afd7f5e3460439ed4204eeae8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 20 Apr 2018 13:15:30 +0200 Subject: [SSUS] Use failprint everywhere --- satellit_upgrader/updater.template.sh | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'satellit_upgrader') diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 221ab42..93638e6 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -476,20 +476,17 @@ if ! id -u dnbd3 &> /dev/null; then dnbd3group=10002 echo "Creating dnbd3 group with gid $dnbd3group" groupadd -g "$dnbd3group" dnbd3 || perror "Could not add dnbd3 group!" - echo "Group added" else echo "Using existing group dnbd3 with gid $dnbd3group" fi echo "Adding user dnbd3" useradd --no-create-home -d /nonexistent -s /bin/false --gid "$dnbd3group" --uid 10002 dnbd3 || perror "Could not add user dnbd3!" - echo "User added" fi if ! dpkg -l "$PACKAGE_LIBJANSSON" | grep -q "^ii\\s.*$PACKAGE_LIBJANSSON"; then echo "Installing $PACKAGE_LIBJANSSON" - if ! apt-get install -y "$PACKAGE_LIBJANSSON" &> "$TMPDIR/apt.log"; then - cat "$TMPDIR/apt.log" + if ! failprint apt-get install -y "$PACKAGE_LIBJANSSON"; then pwarning "*" pwarning "* Warning: Could not install $PACKAGE_LIBJANSSON!" pwarning "*" @@ -497,8 +494,6 @@ if ! dpkg -l "$PACKAGE_LIBJANSSON" | grep -q "^ii\\s.*$PACKAGE_LIBJANSSON"; then pwarning "* Please do either \"apt-get install $PACKAGE_LIBJANSSON\" by hand or" pwarning "* install $PACKAGE_LIBJANSSON otherwise." pwarning "*" - else - echo "Installed" fi fi @@ -516,7 +511,6 @@ fi if diffcp "dnbd3/dnbd3-server.service" "/etc/systemd/system/dnbd3-server.service"; then ln -s -f "../dnbd3-server.service" "/etc/systemd/system/multi-user.target.wants/" systemctl daemon-reload - echo "Service file replaced" fi # ************************** ldadp ************************* @@ -537,7 +531,6 @@ if [ -n "$TGZ_LDADP" ]; then if [ "x$OLD" != "x$NEW" ]; then killall ldadp 2>/dev/null && pwarning "LDAP/AD Proxy was killed. Client logins might not work for a couple of minutes (see Server Status in webif)" fi - echo "LDADP upgrade complete" fi # ************************** tmate ************************ @@ -545,13 +538,11 @@ if ! which tmate > /dev/null 2>&1; 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 ! apt-get update > "$TMPDIR/apt.log" 2>&1; then - cat "$TMPDIR/apt.log" - pwarning "Adding backborts repo: update failed" + if ! failprint apt-get update; then + pwarning "Adding backports repo: update failed" fi echo "Installing package..." - if ! apt-get install -y tmate > "$TMPDIR/apt.log" 2>&1; then - cat "$TMPDIR/apt.log" + if ! failprint apt-get install -y tmate; then 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 -- cgit v1.2.3-55-g7522