|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /proc/self/root/lib/udev/ |
Upload File : |
#!/bin/bash
pos=0
n=0
sp="$1"
what="$2"
found=0
[ -e /proc/sys/dev/cdrom/info ] || exit 1
/bin/cat /proc/sys/dev/cdrom/info | {
while read line; do
if [ "$found" = "0" -a "${line/drive name:}" != "$line" ]; then
set ${line/drive name:}
while [ $# -gt 0 ]; do
pos=$[$pos+1]
if [ "$1" == "$sp" ]; then
found=1
break
fi
shift
done
[ "$found" = "0" ] && exit 1
elif [ "${line/$what:}" != "$line" ]; then
set ${line##*$what:}
while [ $# -gt 0 ]; do
n=$[$n+1]
if [ "$n" == "$pos" ]; then
if [ "$1" = "1" ]; then
exit 0
fi
break
fi
shift
done
fi
done
exit 1
}