anyterm-cmd: Exit loop on empty username.
This commit is contained in:
parent
12cda7f4bb
commit
5a7b652e2d
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue