Commit fda2f8eb by Builder

linux edit

parent b555f4dc
[book]
app_name = "book"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = book
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[cdn]
app_name = "cdn"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = cdn
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[ma]
app_name = "ma"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = ma
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[marketing]
app_name = "marketing"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = marketing
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[official-web]
app_name = "official-web"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = official-web
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[prev_book]
app_name = "prev_book"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = prev_book
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[prev_marketing]
app_name = "prev_marketing"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = prev_marketing
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[prev_official-web]
app_name = "prev_official-web"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = prev_official-web
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[prev_summer-hill]
app_name = "prev_summer-hill"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = prev_summer-hill
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[prev_user-center]
app_name = "prev_user-center"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = prev_user-center
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[sk]
app_name = "sk"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = sk
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[summer-hill]
app_name = "summer-hill"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = summer-hill
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[summer-hill-test]
app_name = "summer-hill-test"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = summer-hill-test
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[user]
app_name = "user"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = user
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[user-center]
app_name = "user-center"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = user-center
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[video-center]
app_name = "video-center"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = video-center
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[www]
app_name = "www"
app_dir = "/web/shenlan"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
app_name = www
app_dir = /web/shenlan
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
[jumper-admin]
app_name = "jumper-admin"
app_dir = "/web/neo"
app_log_dir = ""
app_log_filename = ""
app_uid = "www-data"
app_gid = "www-data"
app_suid = "root"
app_sgid = "root"
\ No newline at end of file
app_name = jumper-admin
app_dir = /web/neo
app_log_dir =
app_log_filename =
app_uid = www-data
app_gid = www-data
app_suid = root
app_sgid = root
......@@ -6,6 +6,7 @@
# @File : checklist.py
# @Software: PyCharm
import sys
from checkitems import *
from tools import getConfig
......@@ -14,31 +15,25 @@ LOG_LIST = ['/usr/local/php7/var/log/php_errors.log']
CONFIG_FILE_NAME = './checklist.conf'
if __name__ == '__main__':
if len(sys.argv) < 2:
if len(sys.argv) < 2:
Usage()
#参数由逗号分隔
appListName = sys.argv[1].split(",")
for appname in appListName:
dict=getConfig(CONFIG_FILE_NAME,apname)
for key,value in dict.items():
print(key,value)
'''
print("\033[1;33;40mALL is checking up......\033[0m")
for appname in appListName:
if appname in APP_LIST:
echo(appname,"is checking......",True)
check(appname,APP_DIR)
else:
try:
app_dict=getConfig(CONFIG_FILE_NAME,appname)
except Exception:
echo(appname,"not available!",False)
echo(appname,"had been checked!",True)
print('*'*80)
sys.exit(1)
#for key,value in dict.items():
# print(key,value)
message("is checking......",appname)
#检查应用路径是否存在软连接、物理路径的权限
check(appname,app_dict['app_dir'])
for log in LOG_LIST:
echo(log,"is checking......",True)
message("is checking......",log)
if checkDirectoryIsWrite(log):
echo(log,"can be writen",True,1)
else:
echo(log,"cannt be writen!",False,1)
echo(log, "had been checked!", True)
print("\033[1;33;40mALL is done to check up\033[0m")
'''
\ No newline at end of file
message(" done","ALL","\033[1;33;40m")
......@@ -21,7 +21,11 @@ def echo(cls,contents,flag,space=0):
if flag:
print("%s\033[1;32;40m[+OK]: '%s' %s\033[0m" % (space,cls,contents))
else:
print("%s\033[5;31;40m[-ERR]: '%s' %s\033[0m" % (space,cls,contents))
print("%s\033[1;31;40m[-ERR]: '%s' %s\033[0m" % (space,cls,contents))
def message(contents,cls="",colour="\033[0;34;40m",space=0):
space="\t"*space
print("%s%s'%s' %s\033[0m" % (space,colour,cls,contents))
def getConfig(config_file,appname):
cfg = ConfigParser.ConfigParser()
......@@ -41,4 +45,4 @@ if __name__ == '__main__':
app_dict=getConfig("checklist.conf","summer-hill")
for key,value in app_dict.items():
print key,value
'''
\ No newline at end of file
'''
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment