dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/mdadm_env.sh

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