summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'init.d/hostname')
-rwxr-xr-xinit.d/hostname7
1 files changed, 5 insertions, 2 deletions
diff --git a/init.d/hostname b/init.d/hostname
index 8efdf96..47c200a 100755
--- a/init.d/hostname
+++ b/init.d/hostname
@@ -3,7 +3,10 @@
# Distributed under the terms of the GNU General Public License v2
start() {
- local myhost=$(/bin/hostname 2>/dev/null)
+ # Ensure that we have a hostname binary or function
+ source /lib/rcscripts/net.modules.d/helpers.d/functions
+
+ local myhost=$(hostname 2>/dev/null)
local retval=0
# If the hostname is already set via the kernel, and /etc/hostname
@@ -20,7 +23,7 @@ start() {
fi
ebegin "Setting hostname to ${myhost}"
- /bin/hostname "${myhost}"
+ hostname "${myhost}"
retval=$?
eend ${retval} "Failed to set the hostname"