Files
new_install/operation/mkraidconf.sh

26 lines
745 B
Bash
Executable File

#!/bin/sh
if [ $1 == "--help" -o $1 == "-h" ];then
echo "mkraidconf.sh [-h|--help] <conf_path>"
echo " This shell make the raid's configure file, the command follow the path of the file, for example /mnt/etc/mdadm.conf. If in the cdrom suggest to use /mnt/etc/mdadm.conf, and in the disk suggest to use /etc/mdadm.conf.Other path you can try, but it may be not work conveniently for the mdadm."
echo ""
echo "Report bugs to <zrlang@linx-info.com>"
exit 0
fi
if [ ! $1 ]; then
echo "error argument, please look the usage by --help or -h"
exit 1
fi
CONDIR=`dirname $1`
if [ ! -d $CONDIR ]; then
mkdir -p $CONDIR
if [ $? != 0 ]; then
echo "error argument, please look the usage by --help or -h"
exit 1
fi
fi
mdadm -Ds -v > $1