From 5a7b652e2df160ec52b9fa60e5e06dd8e42c7375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Bostr=C3=B6m?= Date: Tue, 22 May 2012 12:26:59 +0200 Subject: [PATCH] anyterm-cmd: Exit loop on empty username. --- anyterm-cmd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/anyterm-cmd b/anyterm-cmd index c511d68..b7c916e 100644 --- a/anyterm-cmd +++ b/anyterm-cmd @@ -8,6 +8,10 @@ set -eo pipefail while : ; do echo -n "Username: " read U + if [[ -z "$U" ]]; then + echo "Disconnecting." + exit + fi # Make sure it does not start with a "-" and only contains valid # username characters. if [[ "$U" =~ ^[A-Za-z0-9_][A-Za-z0-9_-]*$ ]]; then