|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/22697/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
}