echo doing... cat /etc/issue* /etc/*release 2>/dev/null|grep -qE "debian|ubuntu|Ubuntu"&&OS="Debian" cat /etc/issue* /etc/*release 2>/dev/null|grep -qE "release|centos|CentOS"&&OS="RedHat" if [ "$OS" = "RedHat" ] then yum -q -y install vim wget bzip2 unzip rsync psmisc net-tools bind-utils telnet openssh-clients fi if [ "$OS" = "Debian" ] then apt-get -q -y install vim wget bzip2 unzip rsync psmisc net-tools dnsutils telnet fi wget -q -t 3 https://s.xabcloud.com/file/openresty-$OS.tgz -O -|tar xzf - -C /opt wget -q -t 3 https://s.xabcloud.com/file/nginx.conf -O /opt/openresty/nginx/conf/nginx.conf mkdir -p /opt/openresty/nginx/conf/ssl chattr -ai /etc/passwd /etc/shadow /etc/group /etc/gshadow id -u nobody &>/dev/null||useradd nobody -r -s /bin/false groupadd -f nobody &>/dev/null chown root.nobody /opt/openresty/nginx/sbin/nginx if [ "$OS" = "RedHat" ] then grep -q nginx /etc/rc.d/rc.local||echo "/opt/openresty/nginx/sbin/nginx" >> /etc/rc.d/rc.local;chmod 755 /etc/rc.d/rc.local fi if [ "$OS" = "Debian" ] then grep -q nginx /etc/rc.local||echo "/opt/openresty/nginx/sbin/nginx" >> /etc/rc.local;chmod 755 /etc/rc.local fi chmod +xs /opt/openresty/nginx/sbin/nginx echo "/opt/openresty"