smokeping一键安装脚本

内容预览:

    #!/bin/bash

    #Date 2017/11/11

    [ $(id -u) != “0” ] && echo “Error: You must be root to run this script” && exit 1

    export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

    sed -i “s/SELINUX=enforcing/SELINUX=disabled/”  /etc/selinux/config

    setenforce 0

    which  ntpdate

    if [ $? -eq 0 ];then

        /usr/sbin/ntpdate time1.aliyun.com

        echo “*/5 * * * * /usr/sbin/ntpdate -s time1.aliyun.com”>>/var/spool/cron/root 

    else

        yum install ntpdate -y

        /usr/sbin/ntpdate time1.aliyun.com

        echo “*/5 * * * * /usr/sbin/ntpdate -s time1.aliyun.com”>>/var/spool/cron/root 

    fi

    clear

    echo “##########################################”

    echo “Auto Install smokeping-2.6.11          ##”

    echo “Press Ctrl + C to cancel                ##”

    echo “Any key to continue                    ##”

    echo “##########################################”

    read -n 1

    /etc/init.d/iptables status >/dev/null 2>&1

    if [ $? -eq 0 ]

    then

    iptables -I INPUT -p tcp –dport 80 -j ACCEPT &&

    iptables-save >/dev/null 2>&1

    else

        echo -e “
    0 条回复 A 作者 M 管理员
      所有的伟大,都源于一个勇敢的开始!
    欢迎您,新朋友,感谢参与互动!欢迎您 {{author}},您在本站有{{commentsCount}}条评论