Managing domain delete and domain create or changed events.
This commit is contained in:
@@ -2,8 +2,14 @@
|
||||
|
||||
JQ="jq -r"
|
||||
|
||||
DOMAIN=$DOMAIN
|
||||
DOMAIN_SOURCE=/domains/$DOMAIN.json
|
||||
DOMAIN=$1
|
||||
DEL=$2
|
||||
if [[ "$DEL" != "" ]]; then
|
||||
echo "$DOMAIN DELETED";
|
||||
exit;
|
||||
fi
|
||||
|
||||
DOMAIN_SOURCE=/domains/$DOMAIN
|
||||
|
||||
DOMAIN_NAME=$(jq -r .DOMAIN $DOMAIN_SOURCE)
|
||||
HTTP_PORT=$(jq -r .HTTP_PORT $DOMAIN_SOURCE)
|
||||
@@ -15,6 +21,9 @@ REDIRECT_HTTP=$(jq -r .REDIRECT_HTTP $DOMAIN_SOURCE)
|
||||
REDIRECT_HTTPS=$(jq -r .REDIRECT_HTTPS $DOMAIN_SOURCE)
|
||||
ERROR_PAGE=$(jq -r .ERROR_PAGE $DOMAIN_SOURCE)
|
||||
|
||||
echo $DOMAIN;
|
||||
exit;
|
||||
|
||||
cd /proxy_config
|
||||
|
||||
file="$DOMAIN.conf"
|
||||
|
@@ -196,10 +196,15 @@ do
|
||||
echo "proxy config created, changed or deleted";
|
||||
check_proxy_state;
|
||||
|
||||
elif [[ "${parent}" == "${DOMAIN_DIR}" && "${op}" == "CLOSE_WRITE,CLOSE" ]] || \
|
||||
[[ "${parent}" == "${DOMAIN_DIR}" && "${op}" == "DELETE" ]] ; then
|
||||
echo "domain config created, changed or deleted";
|
||||
./nginx_config_create.sh;
|
||||
elif [[ "${parent}" == "${DOMAIN_DIR}" && "${op}" == "CLOSE_WRITE,CLOSE" ]]; then
|
||||
DOMAIN=$(echo $file);
|
||||
echo "domain config created, changed";
|
||||
/scripts/nginx_config_create.sh "$DOMAIN";
|
||||
|
||||
elif [[ "${parent}" == "${DOMAIN_DIR}" && "${op}" == "DELETE" ]] ; then
|
||||
DOMAIN=$(echo $file);
|
||||
echo "domain deleted";
|
||||
/scripts/nginx_config_create.sh "$DOMAIN" "DEL";
|
||||
fi
|
||||
|
||||
done
|
||||
|
Reference in New Issue
Block a user