Files
new_install/operation/mkraidconf.sh
2010-09-10 09:10:21 +08:00

34 lines
864 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
CONPATH=`echo $1|sed -e s/[/]/' '/g`
for i in $CONPATH
do
continue
done
CONFILE=$i
CONDIR=`echo $1|sed -e s/$CONFILE/''/g`
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 > $CONDIR$CONFILE