parameters: (db, *, ip)
docstring: Remove all active ban entries for the given IP
docstring_summary: Remove all active ban entries for the given IP
docstring_tokens: Remove all active ban entries for the given IP
function: def command_unban(db, *, ip):
      """Remove all active ban entries for the given IP"""
      if ip == 'all':
          c = db.execute("DELETE FROM ipbans WHERE expires > current_timestamp")
  
      elif ip == 'expired':
          c = db.execute("DELETE FROM ipbans WHERE expires < current_timestamp")
  
      else:
          if '/' in ip:
              ip, subnet = ip.split('/')
              subnet = int(subnet)
          else:
              subnet = 0
  
          c = db.execute(
              "DELETE FROM ipbans WHERE expires > current_timestamp AND ip=? AND subnet=?",
              (ip, subnet)
          )
      db.commit()
  
      print("Removed %d entries" % c.rowcount)
function_tokens: def command_unban ( db , * , ip ) : if ip == 'all' : c = db . execute ( "DELETE FROM ipbans WHERE expires > current_timestamp" ) elif ip == 'expired' : c = db . execute ( "DELETE FROM ipbans WHERE expires < current_timestamp" ) else : if '/' in ip : ip , subnet = ip . split ( '/' ) subnet = int ( subnet ) else : subnet = 0 c = db . execute ( "DELETE FROM ipbans WHERE expires > current_timestamp AND ip=? AND subnet=?" , ( ip , subnet ) ) db . commit ( ) print ( "Removed %d entries" % c . rowcount )