Shell脚本 自动安装nrpe-nightmare
if [ "$Os_is" = "Linux" ] thenipadd=$(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]