Browse Source

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

FreddleSpl0it 1 year ago
parent
commit
c941e802d4
1 changed files with 4 additions and 4 deletions
  1. 4 4
      data/Dockerfiles/netfilter/main.py

+ 4 - 4
data/Dockerfiles/netfilter/main.py

@@ -228,12 +228,12 @@ def clear():
       logger.logWarn('Error clearing redis keys F2B_ACTIVE_BANS and F2B_PERM_BANS: %s' % ex)
 
 def watch():
-  logger.logInfo('Watching Redis channel F2B_CHANNEL')
-  pubsub.subscribe('F2B_CHANNEL')
-
+  global pubsub
   global quit_now
   global exit_code
-  global pubsub
+
+  logger.logInfo('Watching Redis channel F2B_CHANNEL')
+  pubsub.subscribe('F2B_CHANNEL')
 
   while not quit_now:
     try: