#!/bin/bash #wdcp update script #http://www.wdlinux.cn/wdcp cd /tmp function pcre_ins { wget -c http://dl.wdlinux.cn:5180/soft/pcre-8.10.tar.gz tar zxvf pcre-8.10.tar.gz cd pcre-8.10 ./configure --prefix=/usr make make install cd .. } wget -c http://www.nginx.org/download/nginx-1.0.0.tar.gz tar zxvf nginx-1.0.0.tar.gz cd nginx-1.0.0 ./configure --user=www --group=www --prefix=/www/wdlinux/nginx-1.0.0 --with-http_stub_status_module --with-http_ssl_module if [[ $? != 0 ]];then pcre_ins ./configure --user=www --group=www --prefix=/www/wdlinux/nginx-1.0.0 --with-http_stub_status_module --with-http_ssl_module fi make [ $? != 0 ] && echo "make err" && exit make install [ $? != 0 ] && echo "install err" && exit cp /www/wdlinux/nginx/conf/wdcp.conf /www/wdlinux/nginx-1.0.0/conf/ cp /www/wdlinux/nginx/conf/default.conf /www/wdlinux/nginx-1.0.0/conf/ cp /www/wdlinux/nginx/conf/nginx.conf /www/wdlinux/nginx-1.0.0/conf/ cp /www/wdlinux/nginx/conf/fcgi.conf /www/wdlinux/nginx-1.0.0/conf/ cp /www/wdlinux/nginx/conf/naproxy.conf /www/wdlinux/nginx-1.0.0/conf/ cp -pR /www/wdlinux/nginx/conf/rewrite /www/wdlinux/nginx-1.0.0/conf/ cp -pR /www/wdlinux/nginx/conf/vhost /www/wdlinux/nginx-1.0.0/conf/ service nginxd stop rm -f /www/wdlinux/nginx ln -s /www/wdlinux/nginx-1.0.0 /www/wdlinux/nginx service nginxd start echo rm -fr nginx* echo "Updated successfully";