sera/commands/allow.py
def disallow(ctx, delay, from_ip):
    """Delete allowed connection from ip address"""

    if not from_ip:
        ctx.params['from_ip'] = from_ip = requests.get(
            'http://ipinfo.io').json().get('ip')
    if ctx.obj['local']:
        ufw_rule = '"delete allow from %s"' % from_ip
        args = ['printf', ufw_rule, '|', 'at', 'now', '+', str(delay), 'minutes']
        out = run('ufw', args)
    else:
        out = remote('disallow', ctx)
    return lprint(ctx, out)
Delete allowed connection from ip address
Delete allowed connection from ip address
Delete allowed connection from ip address
def disallow(ctx, delay, from_ip):
    if not from_ip:
        ctx.params['from_ip'] = from_ip = requests.get(
            'http://ipinfo.io').json().get('ip')
    if ctx.obj['local']:
        ufw_rule = '"delete allow from %s"' % from_ip
        args = ['printf', ufw_rule, '|', 'at', 'now', '+', str(delay), 'minutes']
        out = run('ufw', args)
    else:
        out = remote('disallow', ctx)
    return lprint(ctx, out)
def disallow ( ctx , delay , from_ip ) : if not from_ip : ctx . params [ 'from_ip' ] = from_ip = requests . get ( 'http://ipinfo.io' ) . json ( ) . get ( 'ip' ) if ctx . obj [ 'local' ] : ufw_rule = '"delete allow from %s"' % from_ip args = [ 'printf' , ufw_rule , '|' , 'at' , 'now' , '+' , str ( delay ) , 'minutes' ] out = run ( 'ufw' , args ) else : out = remote ( 'disallow' , ctx ) return lprint ( ctx , out )
Delete allowed connection from ip address
Delete allowed connection from ip address
"""Delete allowed connection from ip address"""
ctx
delay
from_ip