From 84e7b333a946ae91fbeebc1cca8111b58064fb12 Mon Sep 17 00:00:00 2001 From: Jrohy Date: Thu, 3 Jan 2019 19:36:39 +0800 Subject: [PATCH] Change judge py3 way --- py3_install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/py3_install.sh b/py3_install.sh index 073660a..67c865c 100644 --- a/py3_install.sh +++ b/py3_install.sh @@ -132,13 +132,15 @@ compileInstall(){ webInstall(){ if [[ ${OS} == 'CentOS' || ${OS} == 'Fedora' ]];then [[ ${OS} == 'CentOS' ]] && ${PACKAGE_MANAGER} install epel-release -y - if [[ -z $(rpm -qa|grep python3) ]];then + if ! type python3 >/dev/null 2>&1;then ${PACKAGE_MANAGER} install https://centos7.iuscommunity.org/ius-release.rpm -y ${PACKAGE_MANAGER} install python36u -y ln -s /bin/python3.6 /bin/python3 fi else - [[ -z $(dpkg -l|grep python3) ]] && ${PACKAGE_MANAGER} install python3 -y + if ! type python3 >/dev/null 2>&1;then + ${PACKAGE_MANAGER} install python3 -y + fi ${PACKAGE_MANAGER} install python3-distutils -y >/dev/null 2>&1 fi }