#!/bin/sh # /etc/init.d/hostname # Set the system name to the name stored in /etc/hostname or use a # default value if /etc/hostname does not exist. PATH=/sbin:/bin case $1 in start) if [ -f /etc/hostname ]; then hostname $(cat /etc/hostname) echo "Hostname is set to $(cat /etc/hostname)." else hostname gnu-linux fi ;; *) echo "usage: $0 start" ;; esac