~ubuntu-branches/ubuntu/karmic/debian-installer-utils/karmic

1.1.4 by Colin Watson, Frans Pop, Colin Watson, Updated translations
[ Frans Pop ]
1
#! /bin/sh
2
3
usage () {
4
	echo "Usage: $0 --type|--label|--uuid <device>"
5
}
6
7
case $1 in
8
	--type)
9
		vol_id_opt=--type
10
		blkid_tag=TYPE
11
		;;
12
	--label)
13
		vol_id_opt=--label
14
		blkid_tag=LABEL
15
		;;
16
	--uuid)
17
		vol_id_opt=--uuid
18
		blkid_tag=UUID
19
		;;
20
	*)
21
		usage >&2
22
		exit 1
23
		;;
24
esac
25
shift
26
27
if PATH="/lib/udev:$PATH" type vol_id >/dev/null 2>&1; then
28
	PATH="/lib/udev:$PATH" vol_id "$vol_id_opt" "$1"
29
elif type blkid >/dev/null 2>&1; then
30
	blkid -o value -s "$blkid_tag" "$1"
31
else
32
	exit 1
33
fi