dell服务器,centos系统安装srvadmin脚本

最近安装centos版的srvadmin,咨询dell工程师,最后他们还没有我懂的多,崩溃啊~最后终于在google的大海里找到了答案,把此安装写成脚本,自动运行就可以了,哈哈,太帅了。。。

脚本如下:

#!/bin/bash
######################################
#    create in 2011/4/29 by mark.li  #
######################################
#setup srvadmin.sh

IP=`/sbin/ifconfig -a |grep inet |grep -v "127.0.0.1" |grep -v "inet6" |grep -v "192.168.*.*" |head -1 |awk '{split($2,a,":"); print a[2]}'`

Mailto="[email protected]"

if [ `ps -ef |grep srvadmin |grep -v "grep" |wc -l` -ne 0 ];then
  
    wget -q -O - http://linux.dell.com/repo/hardware/OMSA_6.4/bootstrap.cgi | bash

    yum -y install srvadmin-all
     
    /opt/dell/srvadmin/sbin/srvadmin-services start

    echo "/opt/dell/srvadmin/sbin/srvadmin-services start" >> /etc/rc.d/rc.local

    sed -i "/ESTABLISHED/a\-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1311 -j ACCEPT" /etc/sysconfig/iptables

    service iptables restart

  if [ `lsof -n -i | grep LISTEN |grep dsm_om_co |wc -l` -gt 0 ];then

       echo "srvadmin successfully installed" >/root/srvadmin.log
   fi

else

   echo -e "srvadmin install error" |mail -s "srvadmin install errored on $IP in `date '+%m/%d/%Y %T'`" $Mailto

fi
 

你可能感兴趣的:(centos,职场,dell,休闲,srvadmin)