mirror of
https://github.com/233boy/sing-box.git
synced 2026-05-02 22:04:40 +08:00
add zypper support for SUSE
This commit is contained in:
12
install.sh
12
install.sh
@@ -34,9 +34,9 @@ warn() {
|
|||||||
# root
|
# root
|
||||||
[[ $EUID != 0 ]] && err "当前非 ${yellow}ROOT用户.${none}"
|
[[ $EUID != 0 ]] && err "当前非 ${yellow}ROOT用户.${none}"
|
||||||
|
|
||||||
# yum or apt-get, ubuntu/debian/centos
|
# apt-get, yum or zypper, ubuntu/debian/centos/suse
|
||||||
cmd=$(type -P apt-get || type -P yum)
|
cmd=$(type -P apt-get || type -P yum || type -P zypper)
|
||||||
[[ ! $cmd ]] && err "此脚本仅支持 ${yellow}(Ubuntu or Debian or CentOS)${none}."
|
[[ ! $cmd ]] && err "此脚本仅支持 ${yellow}(Ubuntu or Debian or CentOS or SUSE)${none}."
|
||||||
|
|
||||||
# systemd
|
# systemd
|
||||||
[[ ! $(type -P systemctl) ]] && {
|
[[ ! $(type -P systemctl) ]] && {
|
||||||
@@ -144,7 +144,11 @@ install_pkg() {
|
|||||||
$cmd install -y $pkg &>/dev/null
|
$cmd install -y $pkg &>/dev/null
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
[[ $cmd =~ yum ]] && yum install epel-release -y &>/dev/null
|
[[ $cmd =~ yum ]] && yum install epel-release -y &>/dev/null
|
||||||
$cmd update -y &>/dev/null
|
if [[ $cmd =~ zypper ]]; then
|
||||||
|
$cmd --non-interactive refresh &>/dev/null
|
||||||
|
else
|
||||||
|
$cmd update -y &>/dev/null
|
||||||
|
fi
|
||||||
$cmd install -y $pkg &>/dev/null
|
$cmd install -y $pkg &>/dev/null
|
||||||
[[ $? == 0 ]] && >$is_pkg_ok
|
[[ $? == 0 ]] && >$is_pkg_ok
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ _wget() {
|
|||||||
wget --no-check-certificate "$@"
|
wget --no-check-certificate "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# yum or apt-get
|
# apt-get, yum or zypper
|
||||||
cmd=$(type -P apt-get || type -P yum)
|
cmd=$(type -P apt-get || type -P yum || type -P zypper)
|
||||||
|
|
||||||
# x64
|
# x64
|
||||||
case $(arch) in
|
case $(arch) in
|
||||||
|
|||||||
Reference in New Issue
Block a user