-
Notifications
You must be signed in to change notification settings - Fork 16
/
deleteSMS.sh
19 lines (15 loc) · 1.31 KB
/
deleteSMS.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
# Run this file as root@Openwrt:# bash deleteSMS.sh
# Authored by - Pratik Farkase
echo -e "\n"
echo -e "Enter the Message Number to Delete\n\n--->\c"
read -e MessageNum
echo -e "AT+CMGD=$MessageNum \r\n" > /dev/ttyUSB2 && timeout 2 cat /dev/ttyUSB2 > del.txt
if grep -w -q "OK" del.txt; then
echo -e "\n"
echo -e "###### Message Number $MessageNum Deleted ######\n"
elif grep -w -q "ERROR" del.txt; then
echo -e "\n"
echo -e "###### ERROR Deleting Message, Please Try Again ######"
echo -e "\n"
fi