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

时间:2022-12-02 15:10:13

最近安装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="123@139.com"

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
 

本文出自 “我的运维之路” 博客,请务必保留此出处http://newyue.blog.51cto.com/174760/556457