+ echo "CN: Disabled $serviceconf"
+ mv -f $i $i.disabled
+ changed=1
+ fi
+done
+
+for i in $(find "$TEMPLATES_DIR" -name '*.conf'); do
+ serviceconf=$(basename $i)
+ if [ -r "$MONIT_DIR"/$serviceconf.disabled ]; then
+ check_service "$MONIT_DIR"/$serviceconf.disabled
+ if [ $RET -eq 0 ]; then
+ if [ ! -r "$MONIT_DIR"/$serviceconf ]; then
+ echo "CN: Enabled $serviceconf (previously disabled)"
+ mv "$MONIT_DIR"/$serviceconf.disabled \
+ "$MONIT_DIR"/$serviceconf
+ changed=1
+ fi
+ fi
+ else
+ check_service $i
+ if [ $RET -eq 0 ]; then
+ if [ ! -r "$MONIT_DIR"/$serviceconf ]; then
+ echo "CN: Enabled $serviceconf (new service)"
+ cp -a $i "$MONIT_DIR"
+ changed=1
+ fi