mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-20 07:53:01 +02:00
exoscale: Fix assigning domain name
The whole hostname was used as domain name because there was no . in it where the string could have been split. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -33,10 +33,13 @@ import_exoscale_configuration() {
|
||||
|
||||
# Set domainname
|
||||
if ! grep -q "^DOMAINNAME=" /var/ipfire/main/settings; then
|
||||
local domainname="${hostname#*.}"
|
||||
local domainname="localdomain"
|
||||
|
||||
# Fall back to localdomain
|
||||
[ -z "${domainname}" ] && domainname="localdomain"
|
||||
# If the hostname contains a dot we strip the last
|
||||
# part and use it as our domain name
|
||||
if [[ ${hostname} =~ "\." ]]; then
|
||||
domainname="${hostname#*.}"
|
||||
fi
|
||||
|
||||
echo "DOMAINNAME=${domainname}" >> /var/ipfire/main/settings
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user