1、安装包:kmod-usb-serial kmod-usb-serial-option usb-modeswitch usbutils
2、USB口的打开、关闭
https://openwrt.org/docs/guide-user/hardware/usb.overview
On:
echo 1 > /sys/class/gpio/gpioN/value
Off:
echo 0 > /sys/class/gpio/gpioN/value
Get current state:
cat /sys/class/gpio/gpioN/value
3、参考文档:
https://blog.csdn.net/d9394952/article/details/87868844
https://blog.csdn.net/d9394952/article/details/94197066
http://smstools3.kekekasvi.com/index.php?p=configure
https://lte.pw/lede-openwrt-smstools3-push-sms-to-telegram.html
https://qmsg.zendee.cn/api
https://blog.csdn.net/wh_luosangnanka5/article/details/7779194
https://ozeki-sms-gateway.com/p_136-how-to-receive-an-sms-message-with-a-modem-using-at-commands.html
4、其它参考脚本:
#!/bin/bash ID= #chat_id TOKEN= #token LOOP=3 DATE=$(date '+%Y/%m/%d %H:%M') if [ "$1" == "RECEIVED" ]; then FROM=$(sed -n '1p' < "$2" | awk -F ': ' '{printf $2}') BODY=$(sed -e '1,/^$/ d' < "$2" | iconv -f UNICODEBIG -t UTF-8) CONTENT="新短信%20$DATE%0a来自:%20$FROM%0a$BODY" echo -e "$DATE\n$FROM\n$BODY\n" >> /root/Messenger/sms.log fi toQmsg(){ curl -d "qq=$ID&msg=$CONTENT" https://qmsg.zendee.cn/send/${TOKEN} --retry 3 --retry-delay 5 } toTG(){ curl -d "chat_id=$ID&text=$CONTENT" https://api.telegram.org/bot${TOKEN}/sendMessage --retry 3 --retry-delay 5 } forward(){ #toQmsg #toTG if [ $? -ne 0 -a $LOOP -gt 0 ]; then echo "failure at $(date '+%Y/%m/%d %H:%M')" ((LOOP--)) sleep 60 forward fi } forward
标签:retry,--,sms,SMS,echo,https,USBmodem,openwrt From: https://www.cnblogs.com/d9394/p/17214652.html