support ARM cpu. close #248

pull/519/head^2
233boy 6 years ago
parent aacf1cf7ab
commit 03a274c72f
  1. 30
      install.sh
  2. 6
      src/download-caddy.sh

@ -19,22 +19,40 @@ cmd="apt-get"
sys_bit=$(uname -m)
if [[ $sys_bit == "i386" || $sys_bit == "i686" ]]; then
case $sys_bit in
i[36]86)
v2ray_bit="32"
elif [[ $sys_bit == "x86_64" ]]; then
caddy_arch="386"
;;
x86_64)
v2ray_bit="64"
else
caddy_arch="amd64"
;;
*armv6*)
v2ray_bit="arm"
caddy_arch="arm6"
;;
*armv7*)
v2ray_bit="arm"
caddy_arch="arm7"
;;
*aarch64* | *armv8*)
v2ray_bit="arm64"
caddy_arch="arm64"
;;
*)
echo -e "
哈哈……这个 ${red}辣鸡脚本${none} 不支持你的系统。 ${yellow}(-_-) ${none}
备注: 仅支持 Ubuntu 16+ / Debian 8+ / CentOS 7+ 系统
" && exit 1
fi
;;
esac
# 笨笨的检测方法
if [[ -f /usr/bin/apt-get || -f /usr/bin/yum ]] && [[ -f /bin/systemctl ]]; then
if [[ $(command -v apt-get) || $(command -v yum) ]] && [[ $(command -v systemctl) ]]; then
if [[ -f /usr/bin/yum ]]; then
if [[ $(command -v yum) ]]; then
cmd="yum"

@ -2,11 +2,7 @@ _download_caddy_file() {
caddy_tmp="/tmp/install_caddy/"
caddy_tmp_file="/tmp/install_caddy/caddy.tar.gz"
[[ -d $caddy_tmp ]] && rm -rf $caddy_tmp
if [[ $sys_bit == "i386" || $sys_bit == "i686" ]]; then
local caddy_download_link="https://caddyserver.com/download/linux/386?license=personal"
else
local caddy_download_link="https://caddyserver.com/download/linux/amd64?license=personal"
fi
local caddy_download_link="https://caddyserver.com/download/linux/${caddy_arch}?license=personal"
mkdir -p $caddy_tmp

Loading…
Cancel
Save