mirror of
https://github.com/Ysurac/openmptcprouter-vps-admin.git
synced 2025-03-09 15:40:05 +00:00
Fix remove OpenVPN user
This commit is contained in:
parent
36af20c00e
commit
1f43dec900
1 changed files with 3 additions and 2 deletions
|
@ -1180,8 +1180,9 @@ def remove_user(*, params: RemoveUser,current_user: User = Depends(get_current_u
|
||||||
remove_ss_user(str(shadowsocks_port))
|
remove_ss_user(str(shadowsocks_port))
|
||||||
with open('/etc/openmptcprouter-vps-admin/omr-admin-config.json','w') as f:
|
with open('/etc/openmptcprouter-vps-admin/omr-admin-config.json','w') as f:
|
||||||
json.dump(content,f,indent=4)
|
json.dump(content,f,indent=4)
|
||||||
os.remove('/etc/openvpn/ca/pki/issued/' + params.username + '.crt')
|
os.system('cd /etc/openvpn/ca && ./easyrsa --batch revoke ' + params.username)
|
||||||
os.remove('/etc/openvpn/ca/pki/private/' + params.username + '.key')
|
os.system('cd /etc/openvpn/ca && ./easyrsa gen-crl')
|
||||||
|
os.system("systemctl -q restart openvpn@tun0")
|
||||||
set_lastchange(30)
|
set_lastchange(30)
|
||||||
os.execv(__file__, sys.argv)
|
os.execv(__file__, sys.argv)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue