Skip to content

Commit

Permalink
basic check of the hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
toralf committed Feb 14, 2025
1 parent 7221c9b commit 7ecc43d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bin/create-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ fi

now=${EPOCHSECONDS}

xargs -n 1 <<<$* |
while read -r name; do
if [[ ! $name =~ ^[a-z0-9\-]+$ ]]; then
echo " contains invalid letters: $name" >&2
exit 2
fi
done

set -o pipefail
xargs -n 1 <<<$* |
while read -r name; do
Expand Down Expand Up @@ -92,7 +100,7 @@ xargs -n 1 <<<$* |

$(dirname $0)/update-dns.sh

# wait half a minute before ssh to the instance
# wait half a minute before ssh into the instance
diff=$((EPOCHSECONDS - now))
if [[ ${diff} -lt 30 ]]; then
wait=$((30 - diff))
Expand Down

0 comments on commit 7ecc43d

Please sign in to comment.