danish.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:danish 作者: smutt 项目源码 文件源码
def handleKilling(signal, frame):
  dbgLog(LOG_INFO, "SIG " + str(signal) + " caught, exiting")
  if LOG_OUTPUT == 'file':
    LOG_HANDLE.close()

  # Kill all timer threads
  for thr in threading.enumerate():
    if isinstance(thr, threading._Timer):
      try:
        thr.cancel()
      except:
        pass

  # Clean up iptables
  ipt('-D FORWARD -j ' + IPT_CHAIN)
  subChains = re.findall(re.compile(IPT_CHAIN + '_[a-z,0-9]{20}'), ipt('-L ' + IPT_CHAIN))
  ipt('-F ' + IPT_CHAIN)

  for chain in subChains:
    ipt('-F ' + chain)
    ipt('-X ' + chain)
  ipt('-X ' + IPT_CHAIN)

  if IP6_SUPPORT:
    ipt6('-D FORWARD -j ' + IPT_CHAIN)
    ipt6('-F ' + IPT_CHAIN)

    for chain in subChains:
      ipt6('-F ' + chain)
      ipt6('-X ' + chain)
    ipt6('-X ' + IPT_CHAIN)

  sys.exit(0)


# Logs message to LOG_FNAME or tty
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号