mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 10:37:39 -07:00
fix for missing hostname
This commit is contained in:
parent
859798cb34
commit
155573ac88
3 changed files with 21 additions and 6 deletions
|
@ -365,11 +365,16 @@ if [ -z "$servername" ]; then
|
|||
servername=$(hostname -f)
|
||||
fi
|
||||
|
||||
# Set FQND if it wasn't set
|
||||
# Set FQDN if it wasn't set
|
||||
mask1='(([[:alnum:]](-?[[:alnum:]])*)\.)'
|
||||
mask2='*[[:alnum:]](-?[[:alnum:]])+\.[[:alnum:]]{2,}'
|
||||
if ! [[ "$servername" =~ ^${mask1}${mask2}$ ]]; then
|
||||
servername="$servername.example.com"
|
||||
if [ ! -z "$servername" ]; then
|
||||
servername="$servername.example.com"
|
||||
else
|
||||
servername="example.com"
|
||||
fi
|
||||
echo "127.0.0.1 $servername" >> /etc/hosts
|
||||
fi
|
||||
|
||||
# Set email if it wasn't set
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue