From fe0aa9e412956c0c451fd799d133686b356e1bce Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Fri, 31 Jul 2020 15:37:06 +0200 Subject: [PATCH] fix #2 fix #1 --- setup-remote-host.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setup-remote-host.sh b/setup-remote-host.sh index 1ab8779..5be7b43 100755 --- a/setup-remote-host.sh +++ b/setup-remote-host.sh @@ -35,9 +35,7 @@ if [ ! id -u autossh >/dev/null 2>&1 ]; then useradd -m -s /bin/false autossh fi -if id -u autossh >/dev/null 2>&1; then - echo "OK: user autossh exists." -else +if [ ! id -u autossh >/dev/null 2>&1 ]; then echo "There are some problems with user creation. Exiting." exit 1; fi @@ -63,7 +61,7 @@ echo "OK: File and folder permissions setup." echo "NEXT: Checking for systemd." SYSTEMCTL_CMD=$(which systemctl) -if [[ -z $SYSTEMCTL_CMD ]]; then +if [[ ! -z $SYSTEMCTL_CMD ]]; then echo "NEXT: Copy targets into /etc/default." cp -n targets/* /etc/default/