[anyterm] anyterm-cmd: Exit loop on empty username.
abo
abo at fedoraproject.org
Fri Jun 1 22:18:49 UTC 2012
commit 5a7b652e2df160ec52b9fa60e5e06dd8e42c7375
Author: Alexander Boström <abo at root.snowtree.se>
Date: Tue May 22 12:26:59 2012 +0200
anyterm-cmd: Exit loop on empty username.
anyterm-cmd | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
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
More information about the scm-commits
mailing list