Reverse logic for clearing domain name

This commit is contained in:
James Valleroy 2016-11-06 14:05:32 -05:00
parent 4def7dfa7f
commit d220fa946a
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 4 additions and 3 deletions

View File

@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
- Include module static files in build, required for Debian package build.
- dynamicdns: Allow reading status as non-root.
- config: Set current domainname again after hostname change.
- config: Handle clearing of domain name.
### Changed
- repro: Use firewalld provided SIP services.

View File

@ -18,8 +18,8 @@
domainname="$1"
hostname=$(hostname)
if [ -n "$domainname"] ; then
if [ -z "$domainname" ] ; then
if grep -q 127.0.1.1 /etc/hosts ; then
sed -i "s/127.0.1.1.*/127.0.1.1 $hostname/" /etc/hosts
else
@ -33,4 +33,4 @@ else
sed -i "/127.0.0.1.*/a \
127.0.1.1 $hostname.$domainname $hostname" /etc/hosts
fi
fi
fi