#!/bin/sh # $NetBSD: script,v 1.1 2001/04/25 03:43:29 garbled Exp $ if [ "$2" = "both" -o "$2" = "boot" ]; then echo "$1" >/etc/myname fi if [ "$2" = "both" -o "$2" = "now" ]; then hostname $1 fi if [ "$?" = "0" ]; then echo "Hostname has been changed to $1" else echo "Failed to change hostname to $1" fi