[Ocfs2-tools-devel] [PATCH] A new ocfs2 configure file verify
tool.
tao.ma
tao.ma at oracle.com
Wed Nov 28 22:17:07 PST 2007
胡晓伟 wrote:
> A tool used for verify the ocfs2 configure file.Implemented using BASH
> script.for detail information,see this wiki page:
> http://oss.oracle.com/osswiki/OCFS2/DesignDocs/ClusterVerificationUtility
> Signed-off-by: xiaowei.hu <http://xiaowei.hu> <xiaowei.hu at oracle.com
> <mailto:xiaowei.hu at oracle.com>>
> ---
> ocfs2verify/verif.sh | 661
> ++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 661 insertions(+), 0 deletions(-)
> create mode 100755 ocfs2verify/verif.sh
>
> +check_ip()
> +{
> +local part1
> +local part2
> +local part3
> +local part4
> +#echo "---$1---"
> +if (echo $1|egrep "^([0-9]{1,3}\.){3}[0-9]{1,3}$">/dev/null)
> +then
> + part1=`echo $1|awk 'BEGIN{FS="."}{print $1}'`
> + part2=`echo $1|awk 'BEGIN{FS="."}{print $2}'`
> + part3=`echo $1|awk 'BEGIN{FS="."}{print $3}'`
> + part4=`echo $1|awk 'BEGIN{FS="."}{print $4}'`
> + #echo "$part1-$part2-$part3-$part4"
> + if [[ $part1 < 255 ]] #&& $part2 < 255 && $part3 < 255 && $part4 <
> 255 ]]
Check all the parts?
> + then
> + return $VALID
> + fi
> +fi
> + return $INVALID
> +}
> +
> +#parameter $value $node_num
> +check_number()
> +{
> +local ret
> +if ( [[ -n $1 ]] && (( $1 < 255 || $1 > 0 )) )
It should be "if ( [[ -n $1 ]] && (( $1 < 255 && $1 > 0 )) )"?
> +get_ssh()
> +{
> +if ( check_ip $1;(( $? == $VALID )) )
> +then
> + #echo "connecting"
> + if [[ -f "$TEMP_DIR/$value" ]]
> + then
> + echo -e "$line\e[0;31m......[Duplicated ip_address!]\e[0m"
> + continue
> + else
> + #echo "sshing.............."
> + #echo "$TEMP_DIR/$1"
> + #echo "$COMMAND"
> + ssh 255.255.255.255 <http://255.255.255.255>>/dev/null
> 2>&1
You'd better explain why you want to ssh this ip address?
More information about the Ocfs2-tools-devel
mailing list