From 08b73394ee5ba5eed04cb02b9b3cb96e1e49a58b Mon Sep 17 00:00:00 2001 From: midoks Date: Sun, 11 Apr 2021 12:19:26 +0800 Subject: [PATCH] Update index.py --- plugins/aria2/index.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/plugins/aria2/index.py b/plugins/aria2/index.py index b42bd65bb..380c96b09 100755 --- a/plugins/aria2/index.py +++ b/plugins/aria2/index.py @@ -156,21 +156,24 @@ def initdStatus(): def initdInstall(): - import shutil - if not app_debug: - if mw.isAppleSystem(): - return "Apple Computer does not support" + source_bin = initDreplace() + initd_bin = getInitDFile() + shutil.copyfile(source_bin, initd_bin) + mw.execShell('chmod +x ' + initd_bin) - mw.execShell('systemctl enable ' + getPluginName()) + if not app_debug: + mw.execShell('chkconfig --add ' + getPluginName()) return 'ok' def initdUinstall(): if not app_debug: - if mw.isAppleSystem(): - return "Apple Computer does not support" + mw.execShell('chkconfig --del ' + getPluginName()) - mw.execShell('systemctl disable ' + getPluginName()) + initd_bin = getInitDFile() + + if os.path.exists(initd_bin): + os.remove(initd_bin) return 'ok'