1 Star 0 Fork 127

li.mingliang / PrometheusAlert

forked from feiyu563 / PrometheusAlert 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
docker-entrypoint.sh 980 Bytes
一键复制 编辑 原始数据 按行查看 历史
jikun.zhang 提交于 2022-02-18 15:18 . fix docker-entrypoint.sh error
#!/bin/bash
if [ ! -f /app/db/PrometheusAlertDB.db ]; then
cp /opt/PrometheusAlertDB.db /app/db/PrometheusAlertDB.db
echo 'init ok!'
else
echo 'pass!'
fi
if env | grep -q '^PA_.\+=.\+'; then
for VAR_NAME in $(env | grep '^PA_.\+=.\+' | sed -r "s/^PA_([^=]*).*/\1/g");do
if echo ${VAR_NAME} | grep -q '.*\-.*'; then
echo "\"PA_${VAR_NAME}\" in Environment variable contains '-',this will be ignored."
continue
fi
CONF_ITEM=$(grep -Eio "${VAR_NAME/_/-}|${VAR_NAME}" /app/conf/app.conf)
if [[ -z ${CONF_ITEM} ]]; then
echo "\"PA_${VAR_NAME}\" in Environment variable not found from config file"
continue
fi
CONF_CONTENT=$(eval echo \${PA_${VAR_NAME}})
echo "Config overridden from Environment variable, ${CONF_ITEM}=${CONF_CONTENT}."
sed -i -E "s@(${CONF_ITEM})(\ *=\ *).*@\1\2${CONF_CONTENT}@i" /app/conf/app.conf
done
fi
exec /app/PrometheusAlert
Go
1
https://gitee.com/bfTec/PrometheusAlert.git
git@gitee.com:bfTec/PrometheusAlert.git
bfTec
PrometheusAlert
PrometheusAlert
master

搜索帮助