Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/plugins/sys-opt/index.py

72 lines
1.2 KiB

6 years ago
# coding: utf-8
import time
import random
import os
import json
import re
import sys
sys.path.append(os.getcwd() + "/class/core")
import public
def status():
return 'start'
6 years ago
6 years ago
def start():
public.execShell('sysctl -p')
return 'ok'
def stop():
public.execShell('sysctl -p')
return 'ok'
def restart():
public.execShell('sysctl -p')
return 'ok'
def reload():
public.execShell('sysctl -p')
return 'ok'
6 years ago
def sysConf():
return '/etc/sysctl.conf'
6 years ago
def secRunLog():
return '/var/log/secure'
6 years ago
def msgRunLog():
return '/var/log/message'
def cronRunLog():
return '/var/log/cron'
6 years ago
if __name__ == "__main__":
func = sys.argv[1]
if func == 'status':
print status()
6 years ago
elif func == 'start':
print start()
elif func == 'stop':
print stop()
elif func == 'restart':
print restart()
elif func == 'reload':
print reload()
6 years ago
elif func == 'conf':
print sysConf()
6 years ago
elif func == 'sec_run_log':
6 years ago
print secRunLog()
6 years ago
elif func == 'msg_run_log':
6 years ago
print msgRunLog()
6 years ago
elif func == 'cron_run_log':
6 years ago
print cronRunLog()
6 years ago
else:
6 years ago
print 'err'