[Netfilter] only perform cleanup at exit if SIGTERM was recieved

This commit is contained in:
FreddleSpl0it 2024-02-02 11:08:44 +01:00
parent b236fd3ac6
commit 2072301d89
No known key found for this signature in database
GPG Key ID: 00E14E7634F4BEC5

View File

@ -376,6 +376,11 @@ def quit(signum, frame):
global quit_now
quit_now = True
def quit_clear(signum, frame):
global exit_code
clear()
sys.exit(exit_code)
if __name__ == '__main__':
# init Logger
@ -474,8 +479,7 @@ if __name__ == '__main__':
whitelistupdate_thread.daemon = True
whitelistupdate_thread.start()
signal.signal(signal.SIGTERM, quit)
atexit.register(clear)
signal.signal(signal.SIGTERM, quit_clear)
while not quit_now:
time.sleep(0.5)