diff --git a/sms.py b/sms.py index 009cfc5..dfcb50c 100755 --- a/sms.py +++ b/sms.py @@ -8,7 +8,7 @@ from socket import AF_INET6 from threading import Thread from time import sleep from cgi import FieldStorage -from sys import exit +from os import kill, getpid sms_list_program = '/data/data/com.termux/files/usr/bin/termux-sms-list' sms_send_program = '/data/data/com.termux/files/usr/bin/termux-sms-send' @@ -357,4 +357,6 @@ if __name__ == '__main__': except KeyboardInterrupt: print ('Interrupt received, closing process…') server.server_close () - exit (0) \ No newline at end of file + # BUG: the program must kill itself to end or the user must send Ctrl+C several time to close + # TODO: find another way to close the program in one action, suicide is never the solution + kill (getpid (), 15) \ No newline at end of file