Enhance task execution logic to handle new certificate requests and improve debug output formatting
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -803,6 +803,18 @@ execute_task() {
|
||||
|
||||
TEMPLATE=$(echo "$TEMPLATE" | base64 -w0)
|
||||
JSON_TARGET=$(echo '{ "DATE": "'$DATE'", "STATUS": "0", "TEMPLATE": "'$TEMPLATE'" }' | jq -r . | base64 -w0)
|
||||
|
||||
elif [ "$TASK_NAME" == "letsencrypt" ]; then
|
||||
DOMAINS=$(echo $B64_JSON | base64 -d | jq -r 'keys[]')
|
||||
for DOMAIN in $(echo $DOMAINS); do
|
||||
REQUEST=$(echo $B64_JSON | base64 -d | jq -r ".[\"$DOMAIN\"].status")
|
||||
|
||||
if [ "$REQUEST" == "requested" ]; then
|
||||
echo "New certificate for $DOMAIN is requested."
|
||||
touch /etc/system/data/ssl/keys/$DOMAIN/new_certificate
|
||||
fi
|
||||
done
|
||||
|
||||
elif [ "$DEPLOY_ACTION" == "deploy" ]; then
|
||||
JSON_TARGET=""
|
||||
#JSON_TARGET=$(echo '{ "DATE": "'$DATE'", "STATUS": "1" }' | jq -r . | base64 -w0) # deployment has started
|
||||
@@ -1068,7 +1080,7 @@ inotifywait --exclude "\.(swp|tmp)" -m -e CREATE,CLOSE_WRITE,DELETE,MOVED_TO -r
|
||||
if [ "${op}" == "CLOSE_WRITE,CLOSE" ]; then
|
||||
if [ "$file" != "check_vpn.json" ]; then
|
||||
echo "new file created: $file"
|
||||
fi;
|
||||
fi
|
||||
B64_JSON=$(cat $DIR/$file | base64 -w0)
|
||||
TASK=$(echo $file | cut -d '.' -f1)
|
||||
execute_task "$TASK" "$B64_JSON"
|
||||
|
Reference in New Issue
Block a user