Find and use network name when restarting force the affected backend proxy
This commit is contained in:
@@ -49,6 +49,11 @@ do_proxy_restart() {
|
|||||||
sleep $TIMEOUT;
|
sleep $TIMEOUT;
|
||||||
echo "Proxy "$PROXY_NAME" restarting in progress";
|
echo "Proxy "$PROXY_NAME" restarting in progress";
|
||||||
$service_exec $SERVICE_NAME.containers.$PROXY_NAME stop force;
|
$service_exec $SERVICE_NAME.containers.$PROXY_NAME stop force;
|
||||||
|
|
||||||
|
# finding network name for starting affected network
|
||||||
|
NETWORK_NAME=$(jq -r --arg NAME $PROXY_NAME '.containers[] | select(.NAME==$NAME)' $PROXY_SERVICE_FILE | jq -r .NETWORK)
|
||||||
|
|
||||||
|
$service_exec $SERVICE_NAME.networks.$NETWORK_NAME start
|
||||||
$service_exec $SERVICE_NAME.containers.$PROXY_NAME start
|
$service_exec $SERVICE_NAME.containers.$PROXY_NAME start
|
||||||
if docker ps | grep $PROXY_NAME ; then
|
if docker ps | grep $PROXY_NAME ; then
|
||||||
echo "$PROXY_NAME restarted successful";
|
echo "$PROXY_NAME restarted successful";
|
||||||
|
@@ -17,7 +17,7 @@ mkdir -p $CERT_DIR
|
|||||||
|
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
inotifywait --exclude .sw -m -e CREATE,CLOSE_WRITE,DELETE -r $DOMAIN_DIR $CERT_DIR $PROXY_CONFIG_DIR | \
|
inotifywait --exclude .sw -m -e CREATE,CLOSE_WRITE,DELETE,MOVED_TO -r $DOMAIN_DIR $CERT_DIR $PROXY_CONFIG_DIR | \
|
||||||
while read dir op file
|
while read dir op file
|
||||||
|
|
||||||
do
|
do
|
||||||
|
Reference in New Issue
Block a user