#!/bin/bash watch_folder="/etc/ssl/CA" while true; do csr_file=$(inotifywait -q -e create --format '%f' "${watch_folder}") if [ "${csr_file}" ]; then echo " * Fichier CSR recu" config_file=$(inotifywait -q -e create --format '%f' "${watch_folder}") if [ "${config_file}" ]; then echo " * Fichier CNF recu" /bin/sh /etc/ssl/sign-certificate.sh "${watch_folder}/${csr_file}" "${watch_folder}/${config_file}" "${csr_file}" fi fi done