#!/bin/sh

# if client settings have changed
# and bareos-dir test succeeds (without manual editing the config files, this should always be the case)
# restart bareos-dir
cd /etc/bareos/autogenerated
test clients.include -nt .timestamp -o ! -f .timestamp && su - bareos -s /bin/sh -c "/usr/sbin/bareos-dir -t" && service bareos-dir restart && touch .timestamp
