From 9f7ea642d4fb626c7b77ad36f1be776036af02e2 Mon Sep 17 00:00:00 2001 From: Zac Holland Date: Mon, 18 Dec 2023 12:37:28 -0800 Subject: [PATCH] add &>/dev/null and error messages because commands are sending output to stderr even on success --- tailscale.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tailscale.sh b/tailscale.sh index 9549b7c..38468ca 100644 --- a/tailscale.sh +++ b/tailscale.sh @@ -35,17 +35,17 @@ echo -n "Removing Legacy Installations..." # Stop and disable the systemd service if systemctl is-active --quiet tailscaled; then - systemctl stop tailscaled + systemctl stop tailscaled &>/dev/null || echo "ERROR: could not stop tailscaled" fi if systemctl is-enabled --quiet tailscaled; then - systemctl disable tailscaled + systemctl disable tailscaled &>/dev/null || echo "ERROR: could not disable tailscaled" fi # Remove the systemd system extension if [ $(systemd-sysext list | grep -c "/var/lib/extensions/tailscale") -ne 0 ]; then - systemd-sysext unmerge > /dev/null + systemd-sysext unmerge &>/dev/null || echo "ERROR: could not unmerge system extensions" rm -rf /var/lib/extensions/tailscale - systemd-sysext merge > /dev/null + systemd-sysext merge &>/dev/null || echo "ERROR: could not merge system extensions" fi # Remove the overrides conf @@ -69,7 +69,6 @@ cp -rf $tar_dir/tailscaled /opt/tailscale/tailscaled # add binaries to path via profile.d if ! test -f /etc/profile.d/tailscale.sh; then - mkdir -p /etc/profile.d/tailscale.sh echo 'PATH="$PATH:/home/deck/.bin"' >> /etc/profile.d/tailscale.sh fi