50-net-hostname 246 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
#!/bin/sh -efu
#
# Sets up the node's hostname.

. shell-config

if [ -n "${GLOBAL_TARGET_HOSTNAME:-}" ]; then
	shell_config_set /etc/sysconfig/network 'TARGET_HOSTNAME' "$GLOBAL_TARGET_HOSTNAME"
	echo "$GLOBAL_TARGET_HOSTNAME" >/etc/hostname
fi