mirror of
https://github.com/systemd/systemd.git
synced 2025-03-24 14:50:17 +03:00
hostnamectl: unset pretty hostname only when no target is specified
This commit is contained in:
parent
2d79e90a1f
commit
c388618ec0
@ -267,7 +267,7 @@ static int set_hostname(int argc, char **argv, void *userdata) {
|
||||
/* If the passed hostname is already valid, then assume the user doesn't know anything about pretty
|
||||
* hostnames, so let's unset the pretty hostname, and just set the passed hostname as static/dynamic
|
||||
* hostname. */
|
||||
if (arg_static && hostname_is_valid(hostname, VALID_HOSTNAME_TRAILING_DOT))
|
||||
if (implicit && hostname_is_valid(hostname, VALID_HOSTNAME_TRAILING_DOT))
|
||||
p = ""; /* No pretty hostname (as it is redundant), just a static one */
|
||||
else
|
||||
p = hostname; /* Use the passed name as pretty hostname */
|
||||
|
Loading…
x
Reference in New Issue
Block a user