Last active
December 3, 2022 20:41
-
-
Save artizirk/6307533 to your computer and use it in GitHub Desktop.
send sms with ppp chat program
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ash | |
#using: sendsms +375555555 "some text i want to send" | |
TELFNUMB=$1 | |
SMSTEXT=$2 | |
MODEM="/dev/ttyUSB1" | |
#reg to the network (maybe not needed) | |
gcom reg -d $MODEM | |
# Set modem speed | |
stty -F $MODEM ispeed 9600 | |
#send some AT commands to the modem and hope that it works | |
chat TIMEOUT 1 "" "AT" "OK" > $MODEM | |
chat TIMEOUT 1 "" "AT+CMGF=1" "OK" > $MODEM | |
chat TIMEOUT 1 "" "AT+CMGS=\"$TELFNUMB\"" "OK" > $MODEM | |
chat TIMEOUT 1 "" "$SMSTEXT" "OK" > $MODEM | |
chat TIMEOUT 1 "" "^Z" "OK" > $MODEM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment