docker run CMD & 1custom
This commit is contained in:
Leon 2021-07-27 20:55:15 +08:00
parent 60934dd227
commit e1d1e3f5c5
3 changed files with 65 additions and 16 deletions

View File

@ -22,22 +22,36 @@ docker pull whyour/qinglong:latest
``` sh
docker run -dit \
-v $PWD/ql/config:/ql/config \
-v $PWD/ql/log:/ql/log \
-v $PWD/ql/db:/ql/db \
-v $PWD/ql/repo:/ql/repo \
-v $PWD/ql/raw:/ql/raw \
-v $PWD/ql/scripts:/ql/scripts \
-v $PWD/ql/log:/ql/log \
-v $PWD/ql/jbot:/ql/jbot \
-p 5700:5700 \
-e ENABLE_HANGUP=true \
-e ENABLE_TG_BOT=true \
-e ENABLE_WEB_PANEL=true \
--name qinglong \
--hostname qinglong \
--restart always \
whyour/qinglong:latest
```
#### 2-2 n1等路由器
#### 2-2 N1等路由器
``` sh
docker run -dit \
-v $PWD/ql/config:/ql/config \
-v $PWD/ql/log:/ql/log \
-v $PWD/ql/db:/ql/db \
-v $PWD/ql/repo:/ql/repo \
-v $PWD/ql/raw:/ql/raw \
-v $PWD/ql/scripts:/ql/scripts \
-v $PWD/ql/log:/ql/log \
-v $PWD/ql/jbot:/ql/jbot \
-e ENABLE_HANGUP=true \
-e ENABLE_TG_BOT=true \
-e ENABLE_WEB_PANEL=true \
--net host \
--name qinglong \
--hostname qinglong \
@ -49,18 +63,23 @@ docker run -dit \
``` sh
docker run -dit \
--name QL \
--hostname QL \
--name qinglong \
--hostname qinglong \
--restart always \
--net=macnet \
--ip=192.168.2.20 \
--dns=192.168.2.2 \
--mac-address C2:F2:9C:C5:B1:01 \
-v $PWD/QL/config:/ql/config \
-v $PWD/QL/log:/ql/log \
-v $PWD/QL/db:/ql/db \
-v $PWD/QL/scripts:/ql/scripts \
-v $PWD/QL/jbot:/ql/jbot \
-v $PWD/ql/config:/ql/config \
-v $PWD/ql/db:/ql/db \
-v $PWD/ql/repo:/ql/repo \
-v $PWD/ql/raw:/ql/raw \
-v $PWD/ql/scripts:/ql/scripts \
-v $PWD/ql/log:/ql/log \
-v $PWD/ql/jbot:/ql/jbot \
-e ENABLE_HANGUP=true \
-e ENABLE_TG_BOT=true \
-e ENABLE_WEB_PANEL=true \
whyour/qinglong:latest
```

View File

@ -11,7 +11,7 @@ task_before_shell_path=$dir_shell/task_before.sh
# 控制是否执行变量
read -p "是否全部替换或下载,输入 1 即可全部替换,输入 0 则跳出,默认和其他不全部替换,建议初次配置输入 1" Rall
read -p "是否全部替换或下载,输入 1 即可全部替换,输入 0 则跳出,回车默认和其他可进行部分替换,建议初次配置输入 1" Rall
if [ "${Rall}" = 1 ]; then
echo "将执行全部替换操作"
elif [ "${Rall}" = 0 ]; then
@ -28,6 +28,8 @@ else
Rbefore=${Rbefore:-'y'}
read -p "是否添加 task:ql bot会拉取机器人并自动更新 y/n" Rbot
Rbot=${Rbot:-'y'}
read -p "是否添加 task:自动更新模板(会自动更新对比工具初始模板) y/n" Rsample
Rsample=${Rsample:-'y'}
fi
@ -132,9 +134,9 @@ fi
# 添加定时任务 ql bot
if [ "$(grep -c bot /ql/config/crontab.list)" != 0 ] && [ "${Rbot}" = 'y' -o "${Rall}" = 1 ]; then
if [ "$(grep -c "ql\ bot" /ql/config/crontab.list)" != 0 ] && [ "${Rbot}" = 'y' -o "${Rall}" = 1 ]; then
echo "您的任务列表中已存在 task ql bot"
elif [ "$(grep -c bot /ql/config/crontab.list)" = 0 ] && [ "${Rbot}" = 'y' -o "${Rall}" = 1 ]; then
elif [ "$(grep -c "ql\ bot" /ql/config/crontab.list)" = 0 ] && [ "${Rbot}" = 'y' -o "${Rall}" = 1 ]; then
echo "开始添加 task ql bot"
# 获取token
token=$(cat /ql/config/auth.json | jq --raw-output .token)
@ -144,5 +146,18 @@ else
fi
# 添加定时任务 自动更新模板
if [ "$(grep -c "config.sample.sh" /ql/config/crontab.list)" != 0 ] && [ "${Rsample}" = 'y' -o "${Rall}" = 1 ]; then
echo "您的任务列表中已存在 task 自动更新模板"
elif [ "$(grep -c "config.sample.sh" /ql/config/crontab.list)" = 0 ] && [ "${Rsample}" = 'y' -o "${Rall}" = 1 ]; then
echo "开始添加 task ql bot"
# 获取token
token=$(cat /ql/config/auth.json | jq --raw-output .token)
curl -s -H 'Accept: application/json' -H "Authorization: Bearer $token" -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept-Language: zh-CN,zh;q=0.9' --data-binary '{"name":"自动更新模板","command":"curl -L https://git.io/config.sh -o /ql/sample/config.sample.sh && cp -rf /ql/sample/config.sample.sh /ql/config","schedule":"45 6,18 * * *"}' --compressed 'http://127.0.0.1:5700/api/crons?t=1627380635389'
else
echo "已为您跳过添加定时任务 自动更新模板"
fi
# 提示配置结束
echo "配置到此结束,您是否成功了呢?"

View File

@ -12,7 +12,7 @@ task_before_shell_path=$dir_shell/task_before.sh
# 控制是否执行变量
read -p "是否全部替换或下载,输入 1 即可全部替换,输入 0 则跳出,默认和其他不全部替换,建议初次配置输入 1" Rall
read -p "是否全部替换或下载,输入 1 即可全部替换,输入 0 则跳出,回车默认和其他可进行部分替换,建议初次配置输入 1" Rall
if [ "${Rall}" = 1 ]; then
echo "将执行全部替换操作"
elif [ "${Rall}" = 0 ]; then
@ -29,6 +29,8 @@ else
Rbefore=${Rbefore:-'y'}
read -p "是否添加 task:ql bot会拉取机器人并自动更新 y/n" Rbot
Rbot=${Rbot:-'y'}
read -p "是否添加 task:自动更新模板(会自动更新对比工具初始模板) y/n" Rsample
Rsample=${Rsample:-'y'}
fi
@ -133,9 +135,9 @@ fi
# 添加定时任务 ql bot
if [ "$(grep -c bot /ql/config/crontab.list)" != 0 ] && [ "${Rbot}" = 'y' -o "${Rall}" = 1 ]; then
if [ "$(grep -c "ql\ bot" /ql/config/crontab.list)" != 0 ] && [ "${Rbot}" = 'y' -o "${Rall}" = 1 ]; then
echo "您的任务列表中已存在 task ql bot"
elif [ "$(grep -c bot /ql/config/crontab.list)" = 0 ] && [ "${Rbot}" = 'y' -o "${Rall}" = 1 ]; then
elif [ "$(grep -c "ql\ bot" /ql/config/crontab.list)" = 0 ] && [ "${Rbot}" = 'y' -o "${Rall}" = 1 ]; then
echo "开始添加 task ql bot"
# 获取token
token=$(cat /ql/config/auth.json | jq --raw-output .token)
@ -145,5 +147,18 @@ else
fi
# 添加定时任务 自动更新模板
if [ "$(grep -c "config.sample.sh" /ql/config/crontab.list)" != 0 ] && [ "${Rsample}" = 'y' -o "${Rall}" = 1 ]; then
echo "您的任务列表中已存在 task 自动更新模板"
elif [ "$(grep -c "config.sample.sh" /ql/config/crontab.list)" = 0 ] && [ "${Rsample}" = 'y' -o "${Rall}" = 1 ]; then
echo "开始添加 task ql bot"
# 获取token
token=$(cat /ql/config/auth.json | jq --raw-output .token)
curl -s -H 'Accept: application/json' -H "Authorization: Bearer $token" -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept-Language: zh-CN,zh;q=0.9' --data-binary '{"name":"自动更新模板","command":"curl -L https://git.io/config.sh -o /ql/sample/config.sample.sh && cp -rf /ql/sample/config.sample.sh /ql/config","schedule":"45 6,18 * * *"}' --compressed 'http://127.0.0.1:5700/api/crons?t=1627380635389'
else
echo "已为您跳过添加定时任务 自动更新模板"
fi
# 提示配置结束
echo "配置到此结束,您是否成功了呢?"