Be more cautious about removing munin plugins
[invirt/packages/xvm-munin-config.git] / debian / xvm-munin-host-config.postinst
index 1f64371..fc2de88 100755 (executable)
@@ -37,10 +37,10 @@ EOF
         # Install munin plugins that are now configured
         munin-node-configure --suggest --shell | sh
 
-       (cd /etc/munin/plugins;
+       (cd /etc/munin/plugins &&
            for i in smart_*; do
-               if smartctl -i /dev/${i#smart_} | grep Device | grep EQLOGIC; then
-                   rm -v $i;
+               if smartctl -i "/dev/${i#smart_}" | grep Device | grep EQLOGIC; then
+                   rm -v "$i";
                fi
            done)