|
|
@ -65,7 +65,6 @@ def status(): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def start(): |
|
|
|
def start(): |
|
|
|
file = initDreplace() |
|
|
|
|
|
|
|
data = public.execShell(file + ' start') |
|
|
|
data = public.execShell(file + ' start') |
|
|
|
if data[1] == '': |
|
|
|
if data[1] == '': |
|
|
|
return 'ok' |
|
|
|
return 'ok' |
|
|
@ -73,7 +72,6 @@ def start(): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def stop(): |
|
|
|
def stop(): |
|
|
|
file = initDreplace() |
|
|
|
|
|
|
|
data = public.execShell(file + ' stop') |
|
|
|
data = public.execShell(file + ' stop') |
|
|
|
if data[1] == '': |
|
|
|
if data[1] == '': |
|
|
|
return 'ok' |
|
|
|
return 'ok' |
|
|
@ -124,7 +122,7 @@ def addUser(): |
|
|
|
if not data[0]: |
|
|
|
if not data[0]: |
|
|
|
return data[1] |
|
|
|
return data[1] |
|
|
|
ret = public.execShell('echo ' + args['username'] + '|l2tp -a') |
|
|
|
ret = public.execShell('echo ' + args['username'] + '|l2tp -a') |
|
|
|
if ret[0] == '' |
|
|
|
if ret[0] == '': |
|
|
|
return public.returnJson(True, '添加成功!') |
|
|
|
return public.returnJson(True, '添加成功!') |
|
|
|
return public.returnJson(False, '添加失败:' + ret[1]) |
|
|
|
return public.returnJson(False, '添加失败:' + ret[1]) |
|
|
|
|
|
|
|
|
|
|
@ -136,7 +134,7 @@ def delUser(): |
|
|
|
return data[1] |
|
|
|
return data[1] |
|
|
|
|
|
|
|
|
|
|
|
ret = public.execShell('echo ' + args['username'] + '|l2tp -l') |
|
|
|
ret = public.execShell('echo ' + args['username'] + '|l2tp -l') |
|
|
|
if ret[0] == '' |
|
|
|
if ret[0] == '': |
|
|
|
return public.returnJson(True, '删除成功!') |
|
|
|
return public.returnJson(True, '删除成功!') |
|
|
|
return public.returnJson(False, '删除失败:' + ret[1]) |
|
|
|
return public.returnJson(False, '删除失败:' + ret[1]) |
|
|
|
if __name__ == "__main__": |
|
|
|
if __name__ == "__main__": |
|
|
|