移除 ql -l 参数

This commit is contained in:
whyour 2023-11-23 19:40:52 +08:00
parent 4d97f0f44d
commit 59f7b72bb1
6 changed files with 12 additions and 18 deletions

View File

@ -159,7 +159,7 @@ export default class SystemService {
} }
public async updateSystem() { public async updateSystem() {
const cp = spawn('ql -l update false', { shell: '/bin/bash' }); const cp = spawn('no_tee=true ql update false', { shell: '/bin/bash' });
cp.stdout.on('data', (data) => { cp.stdout.on('data', (data) => {
this.sockService.sendMessage({ this.sockService.sendMessage({
@ -186,7 +186,8 @@ export default class SystemService {
} }
public async reloadSystem(target: 'system' | 'data') { public async reloadSystem(target: 'system' | 'data') {
const cp = spawn(`ql -l reload ${target || ''}`, { shell: '/bin/bash' }); const cmd = `no_tee=true ql reload ${target || ''}`;
const cp = spawn(cmd, { shell: '/bin/bash' });
cp.stdout.on('data', (data) => { cp.stdout.on('data', (data) => {
this.sockService.sendMessage({ this.sockService.sendMessage({

View File

@ -39,13 +39,13 @@ reload_pm2
if [[ $AutoStartBot == true ]]; then if [[ $AutoStartBot == true ]]; then
echo -e "======================5. 启动bot========================\n" echo -e "======================5. 启动bot========================\n"
nohup ql -l bot >$dir_log/bot.log 2>&1 & nohup ql bot >$dir_log/bot.log 2>&1 &
echo -e "bot后台启动中...\n" echo -e "bot后台启动中...\n"
fi fi
if [[ $EnableExtraShell == true ]]; then if [[ $EnableExtraShell == true ]]; then
echo -e "====================6. 执行自定义脚本========================\n" echo -e "====================6. 执行自定义脚本========================\n"
nohup ql -l extra >$dir_log/extra.log 2>&1 & nohup ql extra >$dir_log/extra.log 2>&1 &
echo -e "自定义脚本后台执行中...\n" echo -e "自定义脚本后台执行中...\n"
fi fi

View File

@ -476,8 +476,10 @@ main() {
local log_path="${log_dir}/${log_time}.log" local log_path="${log_dir}/${log_time}.log"
local file_path="$dir_log/$log_path" local file_path="$dir_log/$log_path"
cmd="2>&1 | tee -a $file_path"
if [[ "$no_tee" == "true" ]]; then
cmd=">> $file_path 2>&1" cmd=">> $file_path 2>&1"
[[ "$show_log" == "true" ]] && cmd="" fi
local time_format="%Y-%m-%d %H:%M:%S" local time_format="%Y-%m-%d %H:%M:%S"
local time=$(date "+$time_format") local time=$(date "+$time_format")
@ -490,11 +492,6 @@ main() {
eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd
fi fi
if [[ "$show_log" == "true" ]] && [[ $ID ]]; then
eval echo -e "请移除 -l 参数" $cmd
exit 1
fi
case $p1 in case $p1 in
update) update)
fix_config fix_config
@ -559,10 +556,6 @@ main() {
if [[ "$p1" != "repo" ]] && [[ "$p1" != "raw" ]]; then if [[ "$p1" != "repo" ]] && [[ "$p1" != "raw" ]]; then
eval echo -e "\\\n\#\# 执行结束... $end_time 耗时 $diff_time 秒     " $cmd eval echo -e "\\\n\#\# 执行结束... $end_time 耗时 $diff_time 秒     " $cmd
fi fi
if [[ -f $file_path ]]; then
cat $file_path
fi
} }
main "$@" main "$@"

View File

@ -141,7 +141,7 @@
"服务启动超时": "Service startup timeout", "服务启动超时": "Service startup timeout",
"请先按如下方式修复:": "Please fix it as follows:", "请先按如下方式修复:": "Please fix it as follows:",
"1. 宿主机执行 docker run --rm -v\n /var/run/docker.sock:/var/run/docker.sock\n containrrr/watchtower -cR <容器名>": "1. Execute 'docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower -cR <container_name>' on the host machine", "1. 宿主机执行 docker run --rm -v\n /var/run/docker.sock:/var/run/docker.sock\n containrrr/watchtower -cR <容器名>": "1. Execute 'docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower -cR <container_name>' on the host machine",
"2. 容器内执行 ql -l check、ql -l update": "2. Execute 'ql -l check' and 'ql -l update' inside the container", "2. 容器内执行 ql check、ql update": "2. Execute 'ql check' and 'ql update' inside the container",
"3. 如果无法解决,容器内执行 pm2 logs拷贝执行结果": "3. If the problem persists, execute 'pm2 logs' inside the container and copy the results", "3. 如果无法解决,容器内执行 pm2 logs拷贝执行结果": "3. If the problem persists, execute 'pm2 logs' inside the container and copy the results",
"提交 issue": "Submit an issue", "提交 issue": "Submit an issue",
"启动中,请稍后...": "Starting, please wait...", "启动中,请稍后...": "Starting, please wait...",

View File

@ -141,7 +141,7 @@
"服务启动超时": "服务启动超时", "服务启动超时": "服务启动超时",
"请先按如下方式修复:": "请先按如下方式修复:", "请先按如下方式修复:": "请先按如下方式修复:",
"1. 宿主机执行 docker run --rm -v\n /var/run/docker.sock:/var/run/docker.sock\n containrrr/watchtower -cR <容器名>": "1. 宿主机执行 docker run --rm -v\n /var/run/docker.sock:/var/run/docker.sock\n containrrr/watchtower -cR <容器名>", "1. 宿主机执行 docker run --rm -v\n /var/run/docker.sock:/var/run/docker.sock\n containrrr/watchtower -cR <容器名>": "1. 宿主机执行 docker run --rm -v\n /var/run/docker.sock:/var/run/docker.sock\n containrrr/watchtower -cR <容器名>",
"2. 容器内执行 ql -l check、ql -l update": "2. 容器内执行 ql -l check、ql -l update", "2. 容器内执行 ql check、ql update": "2. 容器内执行 ql check、ql update",
"3. 如果无法解决,容器内执行 pm2 logs拷贝执行结果": "3. 如果无法解决,容器内执行 pm2 logs拷贝执行结果", "3. 如果无法解决,容器内执行 pm2 logs拷贝执行结果": "3. 如果无法解决,容器内执行 pm2 logs拷贝执行结果",
"提交 issue": "提交 issue", "提交 issue": "提交 issue",
"启动中,请稍后...": "启动中,请稍后...", "启动中,请稍后...": "启动中,请稍后...",

View File

@ -71,7 +71,7 @@ const Error = () => {
/var/run/docker.sock:/var/run/docker.sock /var/run/docker.sock:/var/run/docker.sock
containrrr/watchtower -cR &lt;&gt; containrrr/watchtower -cR &lt;&gt;
</div> </div>
<div>{intl.get('2. 容器内执行 ql -l check、ql -l update')}</div> <div>{intl.get('2. 容器内执行 ql check、ql update')}</div>
<div> <div>
{intl.get( {intl.get(
'3. 如果无法解决,容器内执行 pm2 logs拷贝执行结果' '3. 如果无法解决,容器内执行 pm2 logs拷贝执行结果'