#!/bin/sh hostname="$1" echo "$hostname" > /etc/hostname if [ -x /etc/init.d/hostname.sh ] ; then service hostname.sh start else service hostname start fi