Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
M #-: Set hostname over hostnamectl only if it's working
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlastimil Holer committed May 6, 2020
1 parent 94f752c commit 656472c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/etc/one-context.d/net-15-hostname
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
function set_hostname() {
local hostname=$1

if [ -d /run/systemd/system/ ]; then
if [ -d /run/systemd/system/ ] && hostnamectl status >/dev/null 2>/dev/null; then
hostnamectl set-hostname --static "${hostname}"
else
if [ -f /etc/sysconfig/network ]; then
Expand Down

0 comments on commit 656472c

Please sign in to comment.