Skip to content

Commit 67093a6

Browse files
committed
Add sms-free script and fix install
Add sms-free script and fix install Signed-off-by: Bensuperpc <[email protected]>
1 parent 0ce12df commit 67093a6

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ echo "Remove *.sh done"
117117

118118
echo "Remove *.py ..."
119119
# Move it by remove file extension (if does not exit)
120-
find /usr/bin -lname '/usr/bin/ben_script/*.py' | while read -r NAME ; do sudo mv -nv "${NAME}" "${NAME%.sh}" || echo "Fail: ${NAME}" ; done
120+
find /usr/bin -lname '/usr/bin/ben_script/*.py' | while read -r NAME ; do sudo mv -nv "${NAME}" "${NAME%.py}" || echo "Fail: ${NAME}" ; done
121121
echo "Remove *.py done"
122122

123123
echo "Install done"

internet/sms-free.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env python3
2+
#//////////////////////////////////////////////////////////////
3+
#// ____ //
4+
#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ //
5+
#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| //
6+
#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ //
7+
#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| //
8+
#// |_| |_| //
9+
#//////////////////////////////////////////////////////////////
10+
#// //
11+
#// Script, 2021 //
12+
#// Created: 30, July, 2021 //
13+
#// Modified: 30, July, 2021 //
14+
#// file: - //
15+
#// - //
16+
#// Source: https://mobile.free.fr/account/mes-options/notifications-sms //
17+
#// OS: ALL //
18+
#// CPU: ALL //
19+
#// //
20+
#//////////////////////////////////////////////////////////////
21+
22+
import urllib
23+
from urllib import parse, request
24+
import sys
25+
26+
if len(sys.argv) <= 3:
27+
print("Need more arguments: <user> <API key> <Message (in quotes)>")
28+
exit(1)
29+
30+
user = sys.argv[1]
31+
key = sys.argv[2]
32+
msg = sys.argv[3]
33+
34+
payload = { 'user' : user, 'pass' : key, 'msg' : msg}
35+
url = "https://smsapi.free-mobile.fr/sendmsg?"
36+
37+
full_url = url + urllib.parse.urlencode(payload)
38+
39+
try:
40+
response = urllib.request.urlopen(full_url)
41+
code = response.getcode()
42+
print('Return code:', code)
43+
44+
except Exception as e:
45+
print(f'Error: {full_url} : {str(e)}')

0 commit comments

Comments
 (0)