--- src/lib/ip.orig 2017-03-14 18:17:53.000000000 +0100 +++ src/lib/ip 2017-07-08 12:04:48.644198688 +0200 @@ -148,13 +148,31 @@ fi done - if [[ $Hostname ]]; then + if [[ $Hostname ]] && ! [[ $SetHostname ]]; then if ! do_debug hostnamectl set-hostname "$Hostname"; then report_error "Cannot set the hostname to '$Hostname'" return 1 fi fi + if [[ $Hostname ]] && [[ $SetHostname ]]; then + case "$SetHostname" in + transient|static) + if ! do_debug hostnamectl set-hostname --$SetHostname "$Hostname"; then + report_error "Cannot set the $SetHostname hostname to '$Hostname'" + return 1 + fi + ;; + none) + report_error "Not changing any hostname, 'SetHostname' is set to 'none' in this profile" + ;; + *) + report_error "SetHostname must be 'none', 'transient' or 'static'" + return 1 + ;; + esac + fi + if [[ $DNS ]]; then resolvconf_add "$Interface" \ "${DNSDomain/#/domain }" \