Update index.py

This commit is contained in:
midoks
2022-10-10 23:16:48 +08:00
parent 98ec21446d
commit 32bcae603c
+7 -5
View File
@@ -185,14 +185,16 @@ def changeSwap():
size = args['size']
swapOp('stop')
os.system('dd if=/dev/zero of=' + getServerDir() +
'/swapfile bs=1M count=' + size)
os.system('mkswap ' + getServerDir() + '/swapfile')
os.system('chmod 600 ' + getServerDir() + '/swapfile')
cmd = 'dd if=/dev/zero of=' + getServerDir() + '/swapfile bs=1M count=' + size
msg = mw.execShell(cmd)
cmd = 'mkswap ' + getServerDir() + '/swapfile && chmod 600 ' + \
getServerDir() + '/swapfile'
os.system(cmd)
swapOp('start')
return mw.returnJson(True, "修改成功!")
return mw.returnJson(True, "修改成功!" + msg[0])
if __name__ == "__main__":
func = sys.argv[1]