diff --git a/src/download-caddy.sh b/src/download-caddy.sh index d9ea475..ef803c2 100644 --- a/src/download-caddy.sh +++ b/src/download-caddy.sh @@ -2,6 +2,9 @@ _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 [[ ! ${caddy_arch} ]]; then + echo -e "$red 获取 Caddy 下载参数失败!$none" && exit 1 + fi local caddy_download_link="https://caddyserver.com/download/linux/${caddy_arch}?license=personal" mkdir -p $caddy_tmp @@ -33,15 +36,19 @@ _install_caddy_service() { update-rc.d -f caddy defaults fi - mkdir -p /etc/ssl/caddy - if [ -z "$(grep www-data /etc/passwd)" ]; then useradd -M -s /usr/sbin/nologin www-data fi - chown -R www-data.www-data /etc/ssl/caddy + # chown -R www-data.www-data /etc/ssl/caddy - mkdir -p /etc/caddy/ + # ref https://github.com/caddyserver/caddy/tree/master/dist/init/linux-systemd + + mkdir -p /etc/caddy + chown -R root:root /etc/caddy + mkdir -p /etc/ssl/caddy + chown -R root:www-data /etc/ssl/caddy + chmod 0770 /etc/ssl/caddy ## create sites dir mkdir -p /etc/caddy/sites -} \ No newline at end of file +} diff --git a/v2ray.sh b/v2ray.sh index a6eea0d..61ceaba 100644 --- a/v2ray.sh +++ b/v2ray.sh @@ -10,7 +10,7 @@ none='\e[0m' # Root [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 -_version="v3.13" +_version="v3.14" cmd="apt-get"