|
@ -149,7 +149,7 @@ General options: |
|
|
''') |
|
|
''') |
|
|
|
|
|
|
|
|
def main(): |
|
|
def main(): |
|
|
shortopts = 'hadeclu:p:k:O:o:m:t' |
|
|
shortopts = 'adeclu:p:k:O:o:m:t:f:h' |
|
|
longopts = ['help'] |
|
|
longopts = ['help'] |
|
|
action = None |
|
|
action = None |
|
|
user = {} |
|
|
user = {} |
|
@ -178,6 +178,8 @@ def main(): |
|
|
user['protocal'] = value |
|
|
user['protocal'] = value |
|
|
elif key == '-m': |
|
|
elif key == '-m': |
|
|
user['method'] = value |
|
|
user['method'] = value |
|
|
|
|
|
elif key == '-f': |
|
|
|
|
|
user['forbidden_port'] = value |
|
|
elif key == '-t': |
|
|
elif key == '-t': |
|
|
val = float(value) |
|
|
val = float(value) |
|
|
try: |
|
|
try: |
|
@ -196,10 +198,12 @@ def main(): |
|
|
if action == 0: |
|
|
if action == 0: |
|
|
manage.clear_ud(user) |
|
|
manage.clear_ud(user) |
|
|
elif action == 1: |
|
|
elif action == 1: |
|
|
|
|
|
if 'user' not in user and 'port' in user: |
|
|
|
|
|
user['user'] = str(user['port']) |
|
|
if 'user' in user and 'port' in user: |
|
|
if 'user' in user and 'port' in user: |
|
|
manage.add(user) |
|
|
manage.add(user) |
|
|
else: |
|
|
else: |
|
|
print("You have to set the user name and port with -u/-p") |
|
|
print("You have to set the port with -p") |
|
|
elif action == 2: |
|
|
elif action == 2: |
|
|
if 'user' in user or 'port' in user: |
|
|
if 'user' in user or 'port' in user: |
|
|
manage.delete(user) |
|
|
manage.delete(user) |
|
|