lishenghan 发表于 2018-8-22 11:51:09

Shell脚本 自动安装nrpe-nightmare

if [ "$Os_is" = "Linux" ]  then
  ipadd=$(ifconfig | sed -n ‘2p’|awk ‘{print $2}’|awk -F: ‘{print $2}’)
  if [ $Nagios_is = 0 ]
  then
  useradd nagios -s /sbin/nologin
  fi
  elif [ "$Os_is" = "FreeBSD" ]
  then
  ipadd=$(ifconfig | sed -n ‘4p’|awk ‘{print $2}’)
  if [ $Nagios_is = 0 ]
  then
  /usr/sbin/pw useradd nagios -s /sbin/nologin
  fi
  else echo “this is other os,please modify the script”
  exit 1
  fi

页: [1]
查看完整版本: Shell脚本 自动安装nrpe-nightmare