#!/bin/sh if [ $1 == "--help" -o $1 == "-h" ];then echo "mkraidconf.sh [-h|--help] " 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 " 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