码迷,mamicode.com
首页 > 其他好文 > 详细

centos6.7 mutlipath install script

时间:2017-01-06 14:14:54      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:bin   bash   /var   ase   script   tip   chkconfig   var   check   

#!/bin/bash

if [ `id -g` != 0 ] ;then

echo -e "\033[31m Please use root user\033[0m"
exit 1
fi
rpm -qa |grep multipath >/var/log/mapper.log 2>&1
if [ $? = 0 ];then
echo -e "\033[31mERROR : Please check multipath is already installed \033[0m "
exit 7
fi

rpm -ivh --test device-mapper-multipath-0.4.9-87.el6.x86_64.rpm device-mapper-multipath-libs-0.4.9-87.el6.x86_64.rpm >>/var/log/mapper.log 2>&1
if [ $? = 0 ];then

rpm -ivh device-mapper-multipath-0.4.9-87.el6.x86_64.rpm device-mapper-multipath-libs-0.4.9-87.el6.x86_64.rpm >>/var/log/mapper.log 2>&1
else
echo -e "\033[31m ERROR : Test install is not successful , Please view the mapper log /var/log/mapper.log \033[0m"
exit 8
fi
if [ $? = 0 ];then
chkconfig multipathd on &&
service multipathd start >>/var/log/mapper.log 2>&1 &&
cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/multipath.conf >>/var/log/mapper.log 2>&1
multipath -F >>/var/log/mapper.log 2>&1 && multipath -v2 >>/var/log/mapper.log 2>&1 && multipath -ll >>/var/log/mapper.log 2>&1
else
echo -e "\n \033[31m ERROR : Install Error,Please Check!! or view the mapper.log /var/log/mapper.log \033[0m \n"
exit 9
fi

centos6.7 mutlipath install script

标签:bin   bash   /var   ase   script   tip   chkconfig   var   check   

原文地址:http://www.cnblogs.com/xuwenjj/p/6255924.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!