From 7ea486cd1df592d8cbf0248d172c882fa06a287c Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 10 Oct 2022 23:22:43 +0800 Subject: [PATCH] Update index.py --- plugins/swap/index.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/swap/index.py b/plugins/swap/index.py index b4d290f6b..56be0a106 100755 --- a/plugins/swap/index.py +++ b/plugins/swap/index.py @@ -186,9 +186,10 @@ def changeSwap(): size = args['size'] swapOp('stop') - cmd = 'dd if=/dev/zero of=' + getServerDir() + '/swapfile bs=1M count=' + size - cmd += ' && mkswap ' + getServerDir() + '/swapfile && chmod 600 ' + \ - getServerDir() + '/swapfile' + gsdir = getServerDir() + + cmd = 'dd if=/dev/zero of=' + gsdir + '/swapfile bs=1M count=' + size + cmd += ' && mkswap ' + gsdir + '/swapfile && chmod 600 ' + gsdir + '/swapfile' msg = mw.execShell(cmd) swapOp('start')