Browse Source

Fix certbot

lj2007331 8 years ago
parent
commit
139759d3a3
2 changed files with 12 additions and 12 deletions
  1. 11 11
      addons.sh
  2. 1 1
      vhost.sh

+ 11 - 11
addons.sh

@@ -13,7 +13,7 @@ clear
 printf "
 #######################################################################
 #       OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+      #
-#                  Install/Uninstall PHP Extensions                   #
+#                    Install/Uninstall Extensions                     #
 #       For more information please visit https://oneinstack.com      #
 #######################################################################
 "
@@ -75,9 +75,6 @@ if [ -e "${php_install_dir}/bin/phpize" ]; then
       kill -9 $$
       ;;
   esac
-else
-  echo "${CFAILURE}Couldn't find phpize! ${CEND}"
-  kill -9 $$
 fi
 
 # Check PHP Extensions
@@ -124,13 +121,16 @@ EOF
   fi
 
   pushd ${oneinstack_dir}/src
-  if [ ! -e "/usr/bin/pip" ]; then
-    src_url=http://mirrors.linuxeye.com/oneinstack/src/pip-9.0.1.tar.gz && Download_src
-    tar xzf pip-9.0.1.tar.gz
-    pushd pip-9.0.1
-    python setup.py install
-    popd
-    rm -rf pip-9.0.1
+  if [ "${OS}" == "CentOS" ]; then
+    pkgList="gcc dialog augeas-libs openssl openssl-devel libffi-devel redhat-rpm-config ca-certificates python python-devel python-virtualenv python-tools python-pip"
+    for Package in ${pkgList}; do
+      yum -y install ${Package}
+    done
+  elif [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]]; then
+    pkgList="python python-dev virtualenv python-virtualenv gcc dialog libaugeas0 augeas-lenses libssl-dev libffi-dev ca-certificates"
+    for Package in ${pkgList}; do
+      apt-get -y install $Package
+    done
   fi
   if [ ! -e "~/.pip/pip.conf" ] ;then
     # get the IP information

+ 1 - 1
vhost.sh

@@ -238,7 +238,7 @@ EOF
           Cron_Command="/etc/init.d/httpd graceful"
         fi
         [ "${OS}" == "CentOS" ] && Cron_file=/var/spool/cron/root || Cron_file=/var/spool/cron/crontabs/root
-        [ -z "$(grep 'certbot renew' ${Cron_file})" ] && echo "0 0 1 * * certbot renew;${Cron_Command}" >> $Cron_file
+        [ -z "$(grep 'certbot renew' ${Cron_file})" ] && echo "0 0 1 * * /usr/bin/certbot renew --renew-hook \"${Cron_Command}\"" >> $Cron_file
       else
         echo "${CFAILURE}Error: Let's Encrypt SSL certificate installation failed! ${CEND}"
         exit 1