This repository has been archived on 2025-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
Files
docker-salt-master/assets/sbin/config-reloader
Carlos Álvaro a8d39aafe4 feat: Restart salt-master on config changes
Automatically restart salt-master when config changes are detected.
2021-11-28 19:17:08 +01:00

18 lines
423 B
Bash
Executable File

#!/bin/bash
# shellcheck source=assets/runtime/functions.sh
FUNCTIONS_FILE="${SALT_RUNTIME_DIR}/functions.sh"
source "${FUNCTIONS_FILE}"
function check_for_config_changes()
{
inotifywait -qq --recursive \
--event modify,move,create,delete \
"${SALT_CONFS_DIR}"
}
while check_for_config_changes; do
log_info "Configuration changes detected. Reloading salt-master ..."
supervisorctl restart salt-master
done