From 73983673253277faed06aa536fd3c145faece6fa Mon Sep 17 00:00:00 2001 From: Dinko Korunic Date: Tue, 19 Feb 2008 18:08:31 +0000 Subject: [PATCH] r19: * popravljena greska u postinstu vezano uz sed na /etc/default/monit * dodan mailman servis * u update-monit.d dodana funkcionalnost vracanja defaultnih predlozaka -- pri tome se predlozak vraca u default stanje ako i dalje sadrzi genericko CARNet zaglavlje sa upozorenjem --- README.CARNet | 14 +++++------ debian/changelog | 10 ++++++++ debian/postinst | 2 +- monit-cn/amavisd.conf | 7 +++++- monit-cn/aosi.conf | 7 +++++- monit-cn/apache1.conf | 7 +++++- monit-cn/apache2.conf | 7 +++++- monit-cn/asterisk.conf | 7 +++++- monit-cn/bind8.conf | 7 +++++- monit-cn/bind9.conf | 7 +++++- monit-cn/clamd.conf | 7 +++++- monit-cn/cron.conf | 7 +++++- monit-cn/dhcpd3.conf | 7 +++++- monit-cn/dovecot.conf | 7 +++++- monit-cn/exim.conf | 7 +++++- monit-cn/freeradius.conf | 7 +++++- monit-cn/mailman.conf | 10 ++++++++ monit-cn/mysqld.conf | 7 +++++- monit-cn/ntpd.conf | 7 +++++- monit-cn/openldap.conf | 7 +++++- monit-cn/postfix.conf | 7 +++++- monit-cn/postgrey.conf | 7 +++++- monit-cn/proftpd.conf | 7 +++++- monit-cn/qpopper.conf | 7 +++++- monit-cn/samba.conf | 7 +++++- monit-cn/saslauthd.conf | 7 +++++- monit-cn/sendmail.conf | 7 +++++- monit-cn/sophie.conf | 7 +++++- monit-cn/sshd.conf | 7 +++++- monit-cn/syslogd.conf | 7 +++++- monit-cn/thttpd.conf | 7 +++++- monit-cn/tomcat5.conf | 7 +++++- monit-cn/vsftpd.conf | 7 +++++- update-monit.d | 58 +++++++++++++++++++++++++++++++++++++++------- 34 files changed, 252 insertions(+), 45 deletions(-) create mode 100644 monit-cn/mailman.conf diff --git a/README.CARNet b/README.CARNet index 2dc8c50..7b92446 100644 --- a/README.CARNet +++ b/README.CARNet @@ -17,12 +17,12 @@ monit servis ako je aktivan. Za sljedece servise dolaze gotovi predlosci: - amavisd.conf bind9.conf freeradius.conf proftpd.conf sshd.conf - aosi.conf clamd.conf mysqld.conf qpopper.conf syslogd.conf - apache1.conf cron.conf ntpd.conf samba.conf thttpd.conf - apache2.conf dhcpd3.conf openldap.conf saslauthd.conf tomcat5.conf - asterisk.conf dovecot.conf postfix.conf sendmail.conf vsftpd.conf - bind8.conf exim.conf postgrey.conf sophie.conf + amavisd.conf bind9.conf freeradius.conf postgrey.conf sophie.conf + aosi.conf clamd.conf mailman.conf proftpd.conf sshd.conf + apache1.conf cron.conf mysqld.conf qpopper.conf syslogd.conf + apache2.conf dhcpd3.conf ntpd.conf samba.conf thttpd.conf + asterisk.conf dovecot.conf openldap.conf saslauthd.conf tomcat5.conf + bind8.conf exim.conf postfix.conf sendmail.conf vsftpd.conf Primijetite da je monit respawnable proces -- on ne starta kroz /etc/init.d/monit skripte (tzv. System V init skripte), vec kroz @@ -30,4 +30,4 @@ Primijetite da je monit respawnable proces -- on ne starta kroz "padne" ili ga nehotice netko "ubije", on ce se automatski odmah pokrenuti nazad. - -- Dinko Korunic at Thu, 25 Oct 2007 12:06:37 +0200 + -- Dinko Korunic at Tue, 19 Feb 2008 18:59:22 +0100 diff --git a/debian/changelog b/debian/changelog index 0f71a31..97179c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +monit-cn (1:4.8.1-5) stable; urgency=low + + * popravljena greska u postinstu vezano uz sed na /etc/default/monit + * dodan mailman servis + * u update-monit.d dodana funkcionalnost vracanja defaultnih predlozaka -- + pri tome se predlozak vraca u default stanje ako i dalje sadrzi genericko + CARNet zaglavlje sa upozorenjem + + -- Dinko Korunic Tue, 19 Feb 2008 19:07:53 +0100 + monit-cn (1:4.8.1-4) stable; urgency=low * popravljena greska u defaultnom templateu za "alert on" diff --git a/debian/postinst b/debian/postinst index 7324eec..97dd210 100755 --- a/debian/postinst +++ b/debian/postinst @@ -73,7 +73,7 @@ update-monit.d || true # disable monit startup cp_check_and_sed '^startup[[:space:]]*=[[:space:]]*1' \ - '^startup[[:space:]]*=.*/startup=0/g' /etc/default/monit || true + '^s/startup[[:space:]]*=.*/startup=0/g' /etc/default/monit || true # systemv part echo "CN: Disabling monit SystemV script" diff --git a/monit-cn/amavisd.conf b/monit-cn/amavisd.conf index 5a96bad..bc61812 100644 --- a/monit-cn/amavisd.conf +++ b/monit-cn/amavisd.conf @@ -1,4 +1,9 @@ -# amavisd monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process amavisd with pidfile "/var/run/amavis/amavisd.pid" group mail diff --git a/monit-cn/aosi.conf b/monit-cn/aosi.conf index b0e1553..52d0ead 100644 --- a/monit-cn/aosi.conf +++ b/monit-cn/aosi.conf @@ -1,4 +1,9 @@ -# aosi monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check aosi with pidfile "/var/run/aosi/aosi.pid" start program = "/etc/init.d/aosi start" diff --git a/monit-cn/apache1.conf b/monit-cn/apache1.conf index f2902d6..4685561 100644 --- a/monit-cn/apache1.conf +++ b/monit-cn/apache1.conf @@ -1,4 +1,9 @@ -# apache monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process apache with pidfile "/var/run/apache.pid" start program = "/etc/init.d/apache start" diff --git a/monit-cn/apache2.conf b/monit-cn/apache2.conf index c1acb35..5b7a2da 100644 --- a/monit-cn/apache2.conf +++ b/monit-cn/apache2.conf @@ -1,4 +1,9 @@ -# apache2 monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process apache2 with pidfile "/var/run/apache2.pid" start program = "/etc/init.d/apache2 start" diff --git a/monit-cn/asterisk.conf b/monit-cn/asterisk.conf index 76fe53e..83ca337 100644 --- a/monit-cn/asterisk.conf +++ b/monit-cn/asterisk.conf @@ -1,4 +1,9 @@ -# asterisk monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process asterisk with pidfile "/var/run/asterisk.pid" start program = "/etc/init.d/asterisk start" diff --git a/monit-cn/bind8.conf b/monit-cn/bind8.conf index f324f53..77fa193 100644 --- a/monit-cn/bind8.conf +++ b/monit-cn/bind8.conf @@ -1,4 +1,9 @@ -# bind8 monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process bind with pidfile "/var/run/named.pid" start program = "/etc/init.d/bind start" diff --git a/monit-cn/bind9.conf b/monit-cn/bind9.conf index 40e57b3..92e76f1 100644 --- a/monit-cn/bind9.conf +++ b/monit-cn/bind9.conf @@ -1,4 +1,9 @@ -# bind9 monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process bind with pidfile "/var/run/bind/run/named.pid" start program = "/etc/init.d/bind9 start" diff --git a/monit-cn/clamd.conf b/monit-cn/clamd.conf index 9c8708c..28360c1 100644 --- a/monit-cn/clamd.conf +++ b/monit-cn/clamd.conf @@ -1,4 +1,9 @@ -# clamd monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process clamd with pidfile "/var/run/clamav/clamd.pid" group mail diff --git a/monit-cn/cron.conf b/monit-cn/cron.conf index 56753f2..dfee8bb 100644 --- a/monit-cn/cron.conf +++ b/monit-cn/cron.conf @@ -1,4 +1,9 @@ -# crond monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process cron with pidfile "/var/run/cron.pid" group system diff --git a/monit-cn/dhcpd3.conf b/monit-cn/dhcpd3.conf index 5090e6f..5e39bd1 100644 --- a/monit-cn/dhcpd3.conf +++ b/monit-cn/dhcpd3.conf @@ -1,4 +1,9 @@ -# dhcpd monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process dhcpd with pidfile "/var/run/dhcpd.pid" start program = "/etc/init.d/dhcp3-server start" diff --git a/monit-cn/dovecot.conf b/monit-cn/dovecot.conf index 3cfdfec..73bc302 100644 --- a/monit-cn/dovecot.conf +++ b/monit-cn/dovecot.conf @@ -1,4 +1,9 @@ -# dovecot monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process dovecot with pidfile "/var/run/dovecot/master.pid" group mail diff --git a/monit-cn/exim.conf b/monit-cn/exim.conf index 35f256a..0b6468b 100644 --- a/monit-cn/exim.conf +++ b/monit-cn/exim.conf @@ -1,4 +1,9 @@ -# exim monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process exim4 with pidfile "/var/run/exim4/exim.pid" group mail diff --git a/monit-cn/freeradius.conf b/monit-cn/freeradius.conf index eb2bdcd..3ce1f6f 100644 --- a/monit-cn/freeradius.conf +++ b/monit-cn/freeradius.conf @@ -1,4 +1,9 @@ -# freeradius monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check freeradius with pidfile "/var/run/freeradius/freeradius.pid" start program = "/etc/init.d/freeradius start" diff --git a/monit-cn/mailman.conf b/monit-cn/mailman.conf new file mode 100644 index 0000000..ccf75f0 --- /dev/null +++ b/monit-cn/mailman.conf @@ -0,0 +1,10 @@ +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn + +check process mailman with pidfile "/var/run/mailman/mailman.pid" + start program = "/etc/init.d/mailman start" + stop program = "/etc/init.d/mailman stop" diff --git a/monit-cn/mysqld.conf b/monit-cn/mysqld.conf index 857f4d9..128e970 100644 --- a/monit-cn/mysqld.conf +++ b/monit-cn/mysqld.conf @@ -1,4 +1,9 @@ -# mysql monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process mysql with pidfile "/var/run/mysqld/mysqld.pid" start program = "/etc/init.d/mysql start" diff --git a/monit-cn/ntpd.conf b/monit-cn/ntpd.conf index 48f4c25..c8640ca 100644 --- a/monit-cn/ntpd.conf +++ b/monit-cn/ntpd.conf @@ -1,4 +1,9 @@ -# ntp monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process ntpd with pidfile "/var/run/ntpd.pid" start program = "/etc/init.d/ntpd start" diff --git a/monit-cn/openldap.conf b/monit-cn/openldap.conf index 32cf02f..c5b17dc 100644 --- a/monit-cn/openldap.conf +++ b/monit-cn/openldap.conf @@ -1,4 +1,9 @@ -# openldap monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process openldap with pidfile "/var/run/slapd/slapd.pid" start program = "/etc/init.d/slapd start" diff --git a/monit-cn/postfix.conf b/monit-cn/postfix.conf index 6a36dff..b7fe58c 100644 --- a/monit-cn/postfix.conf +++ b/monit-cn/postfix.conf @@ -1,4 +1,9 @@ -# postfix monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process postfix with pidfile "/var/spool/postfix/pid/master.pid" group mail diff --git a/monit-cn/postgrey.conf b/monit-cn/postgrey.conf index 2b939f0..27740d3 100644 --- a/monit-cn/postgrey.conf +++ b/monit-cn/postgrey.conf @@ -1,4 +1,9 @@ -# postgrey monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process postgrey with pidfile "/var/run/postgrey.pid" group mail diff --git a/monit-cn/proftpd.conf b/monit-cn/proftpd.conf index 467ab2d..e67186e 100644 --- a/monit-cn/proftpd.conf +++ b/monit-cn/proftpd.conf @@ -1,4 +1,9 @@ -# proftpd monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process proftpd with pidfile "/var/run/proftpd.pid" start program = "/etc/init.d/proftpd start" diff --git a/monit-cn/qpopper.conf b/monit-cn/qpopper.conf index 1ee0b81..320b63b 100644 --- a/monit-cn/qpopper.conf +++ b/monit-cn/qpopper.conf @@ -1,4 +1,9 @@ -# qpopper monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process qpopper with pidfile "/var/run/popper.pid" group mail diff --git a/monit-cn/samba.conf b/monit-cn/samba.conf index 9582278..dd8bde9 100644 --- a/monit-cn/samba.conf +++ b/monit-cn/samba.conf @@ -1,4 +1,9 @@ -# samba monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process smbd with pidfile "/var/run/samba/smbd.pid" group system diff --git a/monit-cn/saslauthd.conf b/monit-cn/saslauthd.conf index f75e607..b3445a3 100644 --- a/monit-cn/saslauthd.conf +++ b/monit-cn/saslauthd.conf @@ -1,4 +1,9 @@ -# saslauthd monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process saslauthd with pidfile "/var/run/saslauthd/saslauthd.pid" group mail diff --git a/monit-cn/sendmail.conf b/monit-cn/sendmail.conf index 5e8a186..8fc300d 100644 --- a/monit-cn/sendmail.conf +++ b/monit-cn/sendmail.conf @@ -1,4 +1,9 @@ -# sendmail monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process sendmail with pidfile "/var/run/sendmail.pid" group mail diff --git a/monit-cn/sophie.conf b/monit-cn/sophie.conf index d3f2a8a..5028c4a 100644 --- a/monit-cn/sophie.conf +++ b/monit-cn/sophie.conf @@ -1,4 +1,9 @@ -# sophie monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process sophie with pidfile "/var/run/sophie/pid" group mail diff --git a/monit-cn/sshd.conf b/monit-cn/sshd.conf index 9bbd5e2..b160152 100644 --- a/monit-cn/sshd.conf +++ b/monit-cn/sshd.conf @@ -1,4 +1,9 @@ -# sshd monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process sshd with pidfile "/var/run/sshd.pid" start program = "/etc/init.d/ssh start" diff --git a/monit-cn/syslogd.conf b/monit-cn/syslogd.conf index cf65af7..3dc06f6 100644 --- a/monit-cn/syslogd.conf +++ b/monit-cn/syslogd.conf @@ -1,4 +1,9 @@ -# syslogd/klogd monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process syslogd with pidfile "/var/run/syslogd.pid" start program = "/etc/init.d/sysklogd start" diff --git a/monit-cn/thttpd.conf b/monit-cn/thttpd.conf index 7f5d98d..168da25 100644 --- a/monit-cn/thttpd.conf +++ b/monit-cn/thttpd.conf @@ -1,4 +1,9 @@ -# thttpd monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process thttpd with pidfile "/var/run/thttpd.pid" start program = "/etc/init.d/thttpd start" diff --git a/monit-cn/tomcat5.conf b/monit-cn/tomcat5.conf index ac125b2..9395847 100644 --- a/monit-cn/tomcat5.conf +++ b/monit-cn/tomcat5.conf @@ -1,4 +1,9 @@ -# tomcat5 monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process tomcat5 with pidfile "/usr/share/tomcat5/temp/tomcat5.pid" start program = "/etc/init.d/tomcat5 start" diff --git a/monit-cn/vsftpd.conf b/monit-cn/vsftpd.conf index 3bcae87..b6819e5 100644 --- a/monit-cn/vsftpd.conf +++ b/monit-cn/vsftpd.conf @@ -1,4 +1,9 @@ -# vsftpd monit-cn template +## Begin - Generated by CARNet package monit-cn +# +# This is a monit-cn template file. REMOVE this whole comment block if +# you DON'T WANT monit-cn to edit/remove/delete your configuration file. +# +## End - Generated by CARNet package monit-cn check process vsftpd with pidfile "/var/run/vsftpd/vsftpd.pid" start program = "/etc/init.d/vsftpd start" diff --git a/update-monit.d b/update-monit.d index e5235e6..dee92dc 100755 --- a/update-monit.d +++ b/update-monit.d @@ -10,10 +10,11 @@ MONIT_DIR=/etc/monit.d TEMPLATES_DIR=/usr/share/monit-cn + check_service() { RET=0 - filename="$1" + if [ ! -r "$filename" ]; then RET=1 return 1 @@ -89,6 +90,35 @@ check_pid() { return 0 } +check_template() { + RET=0 + filename="$1" + serviceconf=$(basename $i) + + if [ ! -r "$1" ]; then + RET=1 + return 1 + fi + + if [ ! -r "${TEMPLATES_DIR}/${serviceconf}" ]; then + RET=0 + return 0 + fi + + if ! grep -q "^#.*monit-cn template file" "$filename"; then + RET=0 + return 0 + fi + + if ! cmp -s "$filename" "${TEMPLATES_DIR}/${serviceconf}"; then + RET=1 + return 1 + fi + + return $RET +} + + ##################################################################### changed=0 @@ -97,6 +127,16 @@ if [ ! -d "$MONIT_DIR" ]; then fi for i in $(find "$MONIT_DIR" -name '*.conf'); do + check_template $i + if [ ! $RET -eq 0 ]; then + serviceconf=$(basename $i) + echo "CN: Restored default $serviceconf template" + cp -a "${TEMPLATES_DIR}/${serviceconf}" "$MONIT_DIR" + changed=1 + fi +done + +for i in $(find "$MONIT_DIR" -name '*.conf'); do check_service $i if [ ! $RET -eq 0 ]; then serviceconf=$(basename $i) @@ -108,22 +148,22 @@ 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 [ -r "${MONIT_DIR}/${serviceconf}.disabled" ]; then + check_service "${MONIT_DIR}/${serviceconf}.disabled" if [ $RET -eq 0 ]; then - if [ ! -r "$MONIT_DIR"/$serviceconf ]; then + if [ ! -r "${MONIT_DIR}/${serviceconf}" ]; then echo "CN: Enabled $serviceconf (previously disabled)" - mv "$MONIT_DIR"/$serviceconf.disabled \ - "$MONIT_DIR"/$serviceconf + 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 + if [ ! -r "${MONIT_DIR}/${serviceconf}" ]; then echo "CN: Enabled $serviceconf (new service)" - cp -a $i "$MONIT_DIR" + cp -a $i "${MONIT_DIR}" changed=1 fi fi @@ -138,3 +178,5 @@ else fi exit 0 + +# vi:ft=sh -- 1.7.10.4