Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fehler im Skript smartpi_check_umts.sh
#1
Hallo,

im Skript /usr/local/bin/smartpi_check_umts.sh
steht folgender Code:
Code:
if [ $(cat /tmp/logger/modem_idproduct1) = "1f01" ]; then
usb_modeswitch -W -I -v 12d1 -p 1f01 -V 12d1 -P 14db -M "55534243123456780000000000000011062000000100000000000000000000" >> /dev/null 2>&1
echo $(cat /tmp/logger/modem_idproduct1)
fi

if [ $(cat /tmp/logger/modem_idproduct1) = "15ca" ]; then
usb_modeswitch -W -I -v 12d1 -p $(cat /tmp/logger/modem_idproduct1) -M "55534243123456780000000000000011060000000000000000000000000000" >> /dev/null 2>&1
echo $(cat /tmp/logger/modem_idproduct1)
fi

if [ $(cat /tmp/logger/modem_idproduct1) = "14fe" ]; then
usb_modeswitch -W -I -v 12d1 -p $(cat /tmp/logger/modem_idproduct1) -M "55534243123456780000000000000011060000000000000000000000000000" >> /dev/null 2>&1
echo $(cat /tmp/logger/modem_idproduct1)
fi

Dieser erzeugt Fehler im Logfile, da die Datei nicht existiert und evtl. auch leer sein könnte. Daher ist hier mein Vorschlag, das besser zu lösen.
Code:
if [ -f "/tmp/logger/modem_idproduct1" ] && [ "$(cat /tmp/logger/modem_idproduct1)" = "1f01" ]; then
usb_modeswitch -W -I -v 12d1 -p 1f01 -V 12d1 -P 14db -M "55534243123456780000000000000011062000000100000000000000000000" >> /dev/null 2>&1
echo $(cat /tmp/logger/modem_idproduct1)
fi

if [ -f "/tmp/logger/modem_idproduct1" ] && [ "$(cat /tmp/logger/modem_idproduct1)" = "15ca" ]; then
usb_modeswitch -W -I -v 12d1 -p $(cat /tmp/logger/modem_idproduct1) -M "55534243123456780000000000000011060000000000000000000000000000" >> /dev/null 2>&1
echo $(cat /tmp/logger/modem_idproduct1)
fi

if [ -f "/tmp/logger/modem_idproduct1" ] && [ "$(cat /tmp/logger/modem_idproduct1)" = "14fe" ]; then
usb_modeswitch -W -I -v 12d1 -p $(cat /tmp/logger/modem_idproduct1) -M "55534243123456780000000000000011060000000000000000000000000000" >> /dev/null 2>&1
echo $(cat /tmp/logger/modem_idproduct1)
fi


... und noch eine Stelle:
Code:
echo "12d1 $(cat /tmp/modem_idproduct2)" > /sys/bus/usb-serial/drivers/option1/new_id
Diese sollte besser so aussehen:
Code:
[ - f "/tmp/modem_idproduct2" ] && echo "12d1 $(cat /tmp/modem_idproduct2)" > /sys/bus/usb-serial/drivers/option1/new_id


Grüße aus Wuppertal,
Alex
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)