File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,9 +34,9 @@ warn() {
3434# root
3535[[ $EUID != 0 ]] && err " 当前非 ${yellow} ROOT用户.${none} "
3636
37- # yum or apt-get , ubuntu/debian/centos
38- cmd=$( type -P apt-get || type -P yum)
39- [[ ! $cmd ]] && err " 此脚本仅支持 ${yellow} (Ubuntu or Debian or CentOS)${none} ."
37+ # apt-get, yum or zypper , ubuntu/debian/centos/suse
38+ cmd=$( type -P apt-get || type -P yum || type -P zypper )
39+ [[ ! $cmd ]] && err " 此脚本仅支持 ${yellow} (Ubuntu or Debian or CentOS or SUSE )${none} ."
4040
4141# systemd
4242[[ ! $( type -P systemctl) ]] && {
@@ -144,7 +144,11 @@ install_pkg() {
144144 $cmd install -y $pkg & > /dev/null
145145 if [[ $? != 0 ]]; then
146146 [[ $cmd =~ yum ]] && yum install epel-release -y & > /dev/null
147- $cmd update -y & > /dev/null
147+ if [[ $cmd =~ zypper ]]; then
148+ $cmd --non-interactive refresh & > /dev/null
149+ else
150+ $cmd update -y & > /dev/null
151+ fi
148152 $cmd install -y $pkg & > /dev/null
149153 [[ $? == 0 ]] && > $is_pkg_ok
150154 else
Original file line number Diff line number Diff line change @@ -58,8 +58,8 @@ _wget() {
5858 wget --no-check-certificate " $@ "
5959}
6060
61- # yum or apt-get
62- cmd=$( type -P apt-get || type -P yum)
61+ # apt-get, yum or zypper
62+ cmd=$( type -P apt-get || type -P yum || type -P zypper )
6363
6464# x64
6565case $( arch) in
You can’t perform that action at this time.
0 commit comments