From: Stephen Soltesz Date: Mon, 27 Jul 2009 16:32:15 +0000 (+0000) Subject: setup default values if they're not already set. X-Git-Tag: Monitor-3.0-19~7 X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=commitdiff_plain;h=12caba68661a8bc1c36d99850e4938ac02dfa0b2 setup default values if they're not already set. --- diff --git a/Monitor.spec b/Monitor.spec index f8986d9..85ba2eb 100644 --- a/Monitor.spec +++ b/Monitor.spec @@ -240,34 +240,36 @@ if grep 'pam_loginuid.so' /etc/pam.d/crond ; then fi # NOTE: enable monitor by default, since we're installing it. -plc-config --save /etc/planetlab/configs/site.xml \ - --category plc_monitor --variable enabled --value true -plc-config --save /etc/planetlab/configs/site.xml \ - --category plc_monitor --variable from_email --value monitor@localhost.localdomain -plc-config --save /etc/planetlab/configs/site.xml \ - --category plc_monitor --variable cc_email --value monitor@localhost.localdomain -plc-config --save /etc/planetlab/configs/site.xml \ - --category plc_monitor --variable rt_queue --value support - -# NOTE: setup default values until myplc includes them by default. -plc-config --save /etc/planetlab/configs/site.xml \ - --category plc_rt --variable enabled --value false -plc-config --save /etc/planetlab/configs/site.xml \ - --category plc_rt --variable host --value localhost.localdomain -plc-config --save /etc/planetlab/configs/site.xml \ - --category plc_rt --variable ip --value "" -plc-config --save /etc/planetlab/configs/site.xml \ - --category plc_rt --variable web_user --value root -plc-config --save /etc/planetlab/configs/site.xml \ - --category plc_rt --variable web_password --value password +if ! plc-config --category plc_monitor --variable enabled ; then + plc-config --category plc_monitor --variable enabled --value true \ + --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml +fi +if ! plc-config --category plc_monitor --variable from_email ; then + plc-config --category plc_monitor --variable from_email --value monitor@localhost.localdomain \ + --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml +fi +if ! plc-config --category plc_monitor --variable cc_email ; then + plc-config --category plc_monitor --variable cc_email --value monitor@localhost.localdomain \ + --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml +fi +if ! plc-config --category plc_monitor --variable rt_queue ; then + plc-config --category plc_monitor --variable rt_queue --value support \ + --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml +fi # zabbix: -plc-config --save /etc/planetlab/configs/site.xml \ - --category plc_zabbix --variable enabled --value false -plc-config --save /etc/planetlab/configs/site.xml \ - --category plc_zabbix --variable host --value localhost.localdomain -plc-config --save /etc/planetlab/configs/site.xml \ - --category plc_zabbix --variable ip --value "" +if ! plc-config --category plc_zabbix --variable enabled ; then + plc-config --category plc_zabbix --variable enabled --value false \ + --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml +fi +if ! plc-config --category plc_zabbix --variable host ; then + plc-config --category plc_zabbix --variable host --value localhost.localdomain \ + --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml +fi +if ! plc-config --category plc_zabbix --variable ip ; then + plc-config --category plc_zabbix --variable ip --value "" \ + --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml +fi %post server # TODO: this will be nice when we have a web-based service running., such as