aboutsummaryrefslogtreecommitdiff
path: root/bin/awd
blob: e2c86ef792cccc1338850e266c68ffce4f1fd65f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

usage() {
	echo 'usage: awd [label]' 1>&2
	exit 1
}
case $# in
1)
	case "$1" in
	-*)
		usage
		;;
	esac
	sys=$1
	;;
0)
	# hostname -s sets the hostname to "-s" on Solaris
	sys=${sysname:-$(hostname |sed 's/\..*//')}
	;;
*)
	usage
esac

p="`pwd`"
case "$p" in
*/)
	label $p-$sys
	;;
*)
	label $p/-$sys
esac