From ee1717937c2f99ad12071c34314ffb9a95040c65 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Sun, 11 Dec 2022 16:30:54 +0100 Subject: [PATCH] End up with exit code 1 if running init with existing configs --- scripts/ls-configs.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/ls-configs.sh b/scripts/ls-configs.sh index 444a0cf..c17d9b6 100755 --- a/scripts/ls-configs.sh +++ b/scripts/ls-configs.sh @@ -2,9 +2,10 @@ if [ ! -f "$DEVICE.conf" ]; then echo "No configuration: Use command 'init' to create configuration files" -else - echo "Configurations - sorted by creation date" - echo - echo "Server" - cat "$DEVICE.conf" | grep -e "# Client" -e "# <-" | grep -a "#" | sed "s/# //" | sed "s/<- //" | sed "s/\(.*\)\([0-9]\{4\}\)/Created: \1\2\n/" + exit 1 fi + +echo "Configurations - sorted by creation date" +echo +echo "Server" +cat "$DEVICE.conf" | grep -e "# Client" -e "# <-" | grep -a "#" | sed "s/# //" | sed "s/<- //" | sed "s/\(.*\)\([0-9]\{4\}\)/Created: \1\2\n/"