Посмотрите пожалуйста, где я накосячил. Жизненно необходимо - готовится тестовая версия скрипта для чтения смс
Code:
[admin@(none) root]$ state_modem /dev/usb/tts/3 i
Modem port in location /dev/usb/tts/3 not exist
Code:
# Modem Status script for 3G modem
# ver. 1.005 beta 27.02.2011
# by dlukanidin, rss
[admin@(none) root]$ cat /proc/bus/usb/devpath
Device : Location : Info
/dev/usb/tts/0 : 1.4.0 : Manufacturer="HUAWEI Technology" : Product="HUAWEI Mobile"
/dev/usb/tts/1 : 1.4.1 : Manufacturer="HUAWEI Technology" : Product="HUAWEI Mobile"
/dev/usb/tts/2 : 1.4.2 : Manufacturer="HUAWEI Technology" : Product="HUAWEI Mobile"
/dev/usb/tts/3 : 1.4.3 : Manufacturer="HUAWEI Technology" : Product="HUAWEI Mobile"
[admin@(none) root]$ sh -x /usr/sbin/state_modem /dev/usb/tts/3 i
+ isDriversLoaded
+ [ -z ]
+ getKernel
+ uname -r
+ kernel=2.4.37.11
+ kernel=2.4
+ [ 2.4 = 2.4 ]
+ acm_mod=acm
+ lsmod
+ grep usbserial
+ usbserial=usbserial 24196 0 [option]
usbcore 78888 1 [acm option usbserial usb-storage printer ehci-hcd usb-ohci]
+ lsmod
+ grep acm
+ acm=acm 7572 0 (unused)
usbcore 78888 1 [acm option usbserial usb-storage printer ehci-hcd usb-ohci]
+ [ -z usbserial 24196 0 [option]
usbcore 78888 1 [acm option usbserial usb-storage printer ehci-hcd usb-ohci] ]
+ return 0
+ devpath_name=/proc/bus/usb/devpath
+ tmp_name=/tmp/stat.tmp
+ modem_conf_name=/usr/share/modem/modems.conf
+ loc=/dev/usb/tts/3
+ grep : /dev/usb/tts/3 : /proc/bus/usb/devpath
+ awk -F: {print $1}
+ port=
+ lsmodem -c /usr/share/modem/modems.conf
+ loc=/dev/usb/tts/3
+ grep :/dev/usb/tts/3: /tmp/stat.tmp
+ cut -d: -f4
+ type=
+ rm /tmp/stat.tmp
+ [ -z ]
+ echo Modem port in location /dev/usb/tts/3 not exist
Modem port in location /dev/usb/tts/3 not exist
+ exit 2