diff options
Diffstat (limited to 'package/utils/mdadm/files/mdadm.init')
-rw-r--r-- | package/utils/mdadm/files/mdadm.init | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/package/utils/mdadm/files/mdadm.init b/package/utils/mdadm/files/mdadm.init index e6624a776e..64a50b35de 100644 --- a/package/utils/mdadm/files/mdadm.init +++ b/package/utils/mdadm/files/mdadm.init @@ -34,14 +34,13 @@ mdadm_common() { local cfg="$1" local email devices - if [ -x /sbin/sendmail ]; then - append_option email "$cfg" email "MAILADDR" - + if [ -x /usr/sbin/sendmail ]; then + config_get email "$cfg" email + [ -n "$email" ] && printf "MAILADDR %s\n" "$email" >> $CONF fi - append_option devices "$cfg" devices DEVICE " " - - printf "%s\n%s\n" "$email" "$devices" >> $CONF + config_list_foreach "$cfg" devices append_list_item devices " " + [ -n "$devices" ] && printf "DEVICE %s\n" "$devices" >> $CONF } mdadm_array() { |