1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps-admin.git synced 2025-03-09 15:40:05 +00:00

Fix VPS update via API

This commit is contained in:
Ycarus 2021-01-06 09:27:40 +01:00
parent f52acee888
commit d3c61a8689

View file

@ -2203,8 +2203,11 @@ def vpnips(*, vpnconfig: VPNips, current_user: User = Depends(get_current_user))
def update(current_user: User = Depends(get_current_user)):
if current_user.permissions == "ro":
return {'result': 'permission', 'reason': 'Read only user', 'route': 'update'}
os.system("wget -O - http://www.openmptcprouter.com/server/debian9-x86_64.sh | sh")
# Need to reboot if kernel change
LOG.debug("Update VPS...")
os.system("systemctl stop omr")
os.system("wget -O - http://www.openmptcprouter.com/server/debian10-x86_64.sh | sh &")
LOG.debug("Update VPS... done")
os.system("reboot")
return {'result': 'done'}
# Backup