Skip to content

Commit

Permalink
证书管理&&测试tg通知
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejun committed Oct 9, 2024
1 parent bbbff6d commit b36ba99
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ssl/cronSSL.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ sno=${host/s/web}
webIp=$(devil vhost list public | grep "$sno" | awk '{print $1}')
resp=$(devil ssl www add $webIp le le $domain)

cd ${installpath}/serv00-play/ssl

if [[ "$resp" =~ .*succesfully.*$ ]]; then
crontab -l | grep -v "$domain" >tmpcron
crontab tmpcron
rm -rf tmpcron
config="../config.json"
if [ -e "$config" ]; then
tg_token=$(jq -r ".telegram_token" "$config")
tg_userid=$(jq -r ".telegram_userid" "$config")
if [[ -n "$tg_token" && -n "$tg_userid" ]]; then
TELEGRAM_TOKEN=$(jq -r ".telegram_token" "$config")
TELEGRAM_USERID=$(jq -r ".telegram_userid" "$config")
if [[ -n "$TELEGRAM_TOKEN" && -n "$TELEGRAM_USERID" ]]; then
msg="你的域名($domain)申请的SSL证书已下发,请查收!"
cd $installpath/serv00-play
export TELEGRAM_TOKEN="$TELEGRAM_TOKEN" TELEGRAM_USERID="$TELEGRAM_USERID"
./tgsend.sh "$msg"
fi
fi
Expand Down

0 comments on commit b36ba99

Please sign in to comment.