make sed global in case of subdomains
This commit is contained in:
parent
a60e85b9fb
commit
463c5a74c9
|
@ -40,8 +40,8 @@ fi
|
||||||
|
|
||||||
# check for and set username (length between 3 and 12 characters)
|
# check for and set username (length between 3 and 12 characters)
|
||||||
if [[ -z "$username" ]]; then
|
if [[ -z "$username" ]]; then
|
||||||
strippeddomain=`echo $domain | sed 's|\.||'`
|
strippeddomain=`echo $domain | sed 's|\.||g'`
|
||||||
strippeddomain=`echo $strippeddomain | sed 's|-||'`
|
strippeddomain=`echo $strippeddomain | sed 's|-||g'`
|
||||||
username=`echo ${strippeddomain:0:8}`
|
username=`echo ${strippeddomain:0:8}`
|
||||||
if grep -q "^$username:" /etc/passwd; then
|
if grep -q "^$username:" /etc/passwd; then
|
||||||
# username already exists, try another
|
# username already exists, try another
|
||||||
|
|
Loading…
Reference in New Issue
Block a user