From 463c5a74c98e2a3e78820408a5bd276d4269ce0f Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Thu, 16 May 2024 11:02:19 -0700 Subject: [PATCH] make sed global in case of subdomains --- bin/vhost-deploy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/vhost-deploy.sh b/bin/vhost-deploy.sh index 9b96aec..370af3d 100755 --- a/bin/vhost-deploy.sh +++ b/bin/vhost-deploy.sh @@ -40,8 +40,8 @@ fi # check for and set username (length between 3 and 12 characters) if [[ -z "$username" ]]; then - strippeddomain=`echo $domain | sed 's|\.||'` - strippeddomain=`echo $strippeddomain | sed 's|-||'` + strippeddomain=`echo $domain | sed 's|\.||g'` + strippeddomain=`echo $strippeddomain | sed 's|-||g'` username=`echo ${strippeddomain:0:8}` if grep -q "^$username:" /etc/passwd; then # username already exists, try another