dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone
5d5466
#!/bin/sh
5d5466
5d5466
# extract configuration from /etc/sysconfig/mdadm and write
5d5466
# environment to /run/sysconfig/mdadm to be used by
5d5466
# systemd unit files.
5d5466
5d5466
MDADM_SCAN="yes"
5d5466
5d5466
# Following adapted from /etc/init.d/mdadmd on openSUSE
5d5466
5d5466
mdadmd_CONFIG=/etc/sysconfig/mdadm
5d5466
if test -r $mdadmd_CONFIG; then
5d5466
   . $mdadmd_CONFIG
5d5466
fi
5d5466
5d5466
if [ x$MDADM_DELAY != x"" ]; then
5d5466
  MDADM_DELAY="-d "$MDADM_DELAY;
5d5466
fi
5d5466
5d5466
if [ x$MDADM_MAIL != x"" ]; then
5d5466
  MDADM_MAIL="-m \"$MDADM_MAIL\""
5d5466
fi
5d5466
5d5466
if [ x$MDADM_PROGRAM != x"" ]; then
5d5466
  MDADM_PROGRAM="-p \"$MDADM_PROGRAM\""
5d5466
fi
5d5466
5d5466
if [ x$MDADM_SCAN = x"yes" ]; then
5d5466
  MDADM_SCAN="--scan"
5d5466
else
5d5466
  MDADM_SCAN=""
5d5466
fi
5d5466
5d5466
if [ x$MDADM_SEND_MAIL_ON_START = x"yes" ]; then
5d5466
  MDADM_SEND_MAIL="-t"
5d5466
else
5d5466
  MDADM_SEND_MAIL=""
5d5466
fi
5d5466
5d5466
if [ x$MDADM_CONFIG != x"" ]; then
5d5466
  MDADM_CONFIG="-c \"$MDADM_CONFIG\""
5d5466
fi
5d5466
5d5466
mkdir -p /run/sysconfig
5d5466
echo "MDADM_MONITOR_ARGS=$MDADM_RAIDDEVICES $MDADM_DELAY $MDADM_MAIL $MDADM_PROGRAM $MDADM_SCAN $MDADM_SEND_MAIL $MDADM_CONFIG" > /run/sysconfig/mdadm
5d5466
if [ -n "$MDADM_CHECK_DURATION" ]; then
5d5466
 echo "MDADM_CHECK_DURATION=$MDADM_CHECK_DURATION" >> /run/sysconfig/mdadm
5d5466
fi