aboutsummaryrefslogtreecommitdiff
path: root/bin/awd
blob: eed97fe1fdad3a8cf8f172ff4d360c1a22cff34b (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=`hostname |sed 's/\..*//'`
	;;
*)
	usage
esac

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