aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorDevin Teske <dteske@FreeBSD.org>2018-10-26 01:06:03 +0000
committerDevin Teske <dteske@FreeBSD.org>2018-10-26 01:06:03 +0000
commit6fd587f9f9fa068f6a269a0ea27a303ac33f62aa (patch)
tree649f87b6a36ccbe71c1e81cb30c67dc0227e525a /usr.sbin
parent05b1c42540ae1b8fb5d940a87f8810e3fa746522 (diff)
Notes
Diffstat (limited to 'usr.sbin')
-rwxr-xr-xusr.sbin/bsdinstall/scripts/hostname11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.sbin/bsdinstall/scripts/hostname b/usr.sbin/bsdinstall/scripts/hostname
index 0ea5d5440db6..4fbce415e65d 100755
--- a/usr.sbin/bsdinstall/scripts/hostname
+++ b/usr.sbin/bsdinstall/scripts/hostname
@@ -56,6 +56,12 @@ msg_please_choose_a_hostname="Please choose a hostname for this machine.\n\nIf y
msg_ok="OK"
msg_freebsd_installer="FreeBSD Installer"
+#
+# Command strings for various tasks
+#
+ECHO_OVERWRITE='echo "%s" > "%s"'
+SET_HOSTNAME='hostname -s "%s"'
+
############################################################ FUNCTIONS
# dialog_hostname
@@ -100,14 +106,15 @@ HOSTNAME=$( dialog_hostname "$HOSTNAME" )
#
# Store the user's choice
#
-echo "hostname=\"$HOSTNAME\"" > "$HOSTNAMEFILE"
+f_eval_catch "$pgm" echo "$ECHO_OVERWRITE" \
+ 'hostname=\"$HOSTNAME\"' "$HOSTNAMEFILE"
retval=$?
#
# Activate entry if configured
#
if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
- hostname -s "$HOSTNAME"
+ f_eval_catch "$pgm" hostname "$SET_HOSTNAME" "$HOSTNAME"
retval=$?
fi