summaryrefslogtreecommitdiff
path: root/share/sushi/network/hostname/script
blob: 831127d63c03c742683fca7ebbc7a0bea7e9a811 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/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