We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06f8288 commit 3147a41Copy full SHA for 3147a41
templates/common/_base/files/usr-local-bin-mco-hostname.yaml
@@ -20,9 +20,11 @@ contents:
20
do
21
sleep 1
22
done
23
- echo "node identified as $(</proc/sys/kernel/hostname)"
+ HOSTNAME="$(</proc/sys/kernel/hostname)"
24
+ CLEAN_HOSTNAME="${HOSTNAME%.}"
25
+ echo "node identified as $CLEAN_HOSTNAME"
26
echo "saving hostname to prevent NetworkManager from ever unsetting it"
- hostnamectl set-hostname --static --transient $(</proc/sys/kernel/hostname)
27
+ hostnamectl set-hostname --static --transient "$CLEAN_HOSTNAME"
28
exit 0
29
}
30
0 commit comments