|
|
|
@ -238,13 +238,7 @@ def initdStatus(): |
|
|
|
|
if current_os == 'darwin': |
|
|
|
|
return "Apple Computer does not support" |
|
|
|
|
|
|
|
|
|
if current_os.startswith('freebsd'): |
|
|
|
|
initd_bin = getInitDFile() |
|
|
|
|
if os.path.exists(initd_bin): |
|
|
|
|
return 'ok' |
|
|
|
|
|
|
|
|
|
shell_cmd = 'systemctl status ' + \ |
|
|
|
|
getPluginName() + ' | grep loaded | grep "enabled;"' |
|
|
|
|
shell_cmd = 'systemctl status zabbix-server | grep loaded | grep "enabled;"' |
|
|
|
|
data = mw.execShell(shell_cmd) |
|
|
|
|
if data[0] == '': |
|
|
|
|
return 'fail' |
|
|
|
@ -256,17 +250,7 @@ def initdInstall(): |
|
|
|
|
if current_os == 'darwin': |
|
|
|
|
return "Apple Computer does not support" |
|
|
|
|
|
|
|
|
|
# freebsd initd install |
|
|
|
|
if current_os.startswith('freebsd'): |
|
|
|
|
import shutil |
|
|
|
|
source_bin = initDreplace() |
|
|
|
|
initd_bin = getInitDFile() |
|
|
|
|
shutil.copyfile(source_bin, initd_bin) |
|
|
|
|
mw.execShell('chmod +x ' + initd_bin) |
|
|
|
|
mw.execShell('sysrc ' + getPluginName() + '_enable="YES"') |
|
|
|
|
return 'ok' |
|
|
|
|
|
|
|
|
|
mw.execShell('systemctl enable ' + getPluginName()) |
|
|
|
|
mw.execShell('systemctl enable zabbix-server') |
|
|
|
|
return 'ok' |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -275,13 +259,7 @@ def initdUinstall(): |
|
|
|
|
if current_os == 'darwin': |
|
|
|
|
return "Apple Computer does not support" |
|
|
|
|
|
|
|
|
|
if current_os.startswith('freebsd'): |
|
|
|
|
initd_bin = getInitDFile() |
|
|
|
|
os.remove(initd_bin) |
|
|
|
|
mw.execShell('sysrc ' + getPluginName() + '_enable="NO"') |
|
|
|
|
return 'ok' |
|
|
|
|
|
|
|
|
|
mw.execShell('systemctl disable ' + getPluginName()) |
|
|
|
|
mw.execShell('systemctl disable zabbix-server') |
|
|
|
|
return 'ok' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|