2024-02-26 16:47:11 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ -n "${new_host_name}" ]; then
|
2024-05-07 14:46:59 +00:00
|
|
|
fullname="${new_host_name}"
|
|
|
|
if [ -n "${new_domain_name}" ]; then
|
|
|
|
fullname="${fullname}.${new_domain_name}"
|
|
|
|
fi
|
2024-02-26 16:47:11 +00:00
|
|
|
cat << EOName > /etc/hostname
|
2024-05-07 14:46:59 +00:00
|
|
|
${fullname}
|
2024-02-26 16:47:11 +00:00
|
|
|
EOName
|
2024-05-07 14:46:59 +00:00
|
|
|
unset fullname
|
2024-02-26 16:47:11 +00:00
|
|
|
hostname -F /etc/hostname
|
|
|
|
fi
|