A check_sms/get_SMS.sh => check_sms/get_SMS.sh +37 -0
@@ 0,0 1,37 @@
+#!/bin/bash
+
+repeat="Y"
+country=$1
+curl -s https://online-sms.org/Free-$country-Phone-Number | grep "Receive SMS" > numbers_list
+list=$(while read -r line; do echo "$line" | tr -dc '0-9'; echo -e "\n"; done < numbers_list)
+
+echo "Numbers from $country:"
+echo $list
+
+echo -e "\nSelecting random..."
+my_list=($list)
+
+lenght_=${#my_list[@]}
+random_n=$(( $RANDOM % $lenght_ + 1 ))
+
+echo "the random number selected is ${my_list[$random_n]}"
+echo -e "\n"
+read -p"Click ENTER when you used the number" DUMMY
+
+base="https://online-sms.org/free-phone-number-"
+number="${my_list[$random_n]}"
+
+link="$base$number"
+
+while [ "$repeat" = "Y" ]
+do
+ curl -s $link > last_sms
+ strings last_sms | grep -A11 Sender > last_sms_value
+ rm last_sms
+ strings last_sms_value | sed 's/<[^>]*>/\n/g' > last_sms_wout_html
+ rm last_sms_value
+
+ strings last_sms_wout_html
+
+ read -p"Keep receiving message from this number? Y/N: " repeat
+done