aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/mdadm/files
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2017-10-17 09:28:39 -0700
committerJo-Philipp Wich <jo@mein.io>2017-10-27 02:32:32 +0200
commit8eadec40bdc205568e34e19b07b2a3035c9223fb (patch)
tree37671a1b48255b9d9cd3c7bd8a971b54af0db306 /package/utils/mdadm/files
parent378e1a4858b9c51e6fcf396adc602fd835280759 (diff)
downloadupstream-8eadec40bdc205568e34e19b07b2a3035c9223fb.tar.gz
upstream-8eadec40bdc205568e34e19b07b2a3035c9223fb.tar.bz2
upstream-8eadec40bdc205568e34e19b07b2a3035c9223fb.zip
mdadm: Fix config generation
The init script generated something like "DEVICE=/dev/sda" when it should have been generating "DEVICE /dev/sda". mdadm errors on this. Patch by jow. Also changed the default sendmail path to /usr/sbin/sendmail. No package in LEDE provides /sbin/sendmail. msmtp provides /usr/sbin/sendmail so use that. Also add a patch to fix file paths for mdadm runtime files. mdadm currently errors on them since /run is missing. Once /run is added to stock LEDE, this patch can be removed. Signed-off-by: Rosen Penev <rosenp@gmail.com> [rewrap commit message] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'package/utils/mdadm/files')
-rw-r--r--package/utils/mdadm/files/mdadm.init11
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() {