#!/bin/sh . /root/common.sh while inotifywait -q -r -e create -e modify -e delete -e move \ --exclude .swp "${CONF}"; do if nginx -t; then echo "reloader: new configuration" "${BIN}" -s reload RELOAD_FIRST=no /root/acme-autocert.sh else echo "reloader: invalid configuration" fi done