fix caddy cannot running issue

pull/345/head
233boy 5 years ago
parent ebcbbc2e52
commit f5b943f8b7
  1. 15
      src/download-caddy.sh
  2. 2
      v2ray.sh

@ -2,6 +2,9 @@ _download_caddy_file() {
caddy_tmp="/tmp/install_caddy/" caddy_tmp="/tmp/install_caddy/"
caddy_tmp_file="/tmp/install_caddy/caddy.tar.gz" caddy_tmp_file="/tmp/install_caddy/caddy.tar.gz"
[[ -d $caddy_tmp ]] && rm -rf $caddy_tmp [[ -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" local caddy_download_link="https://caddyserver.com/download/linux/${caddy_arch}?license=personal"
mkdir -p $caddy_tmp mkdir -p $caddy_tmp
@ -33,14 +36,18 @@ _install_caddy_service() {
update-rc.d -f caddy defaults update-rc.d -f caddy defaults
fi fi
mkdir -p /etc/ssl/caddy
if [ -z "$(grep www-data /etc/passwd)" ]; then if [ -z "$(grep www-data /etc/passwd)" ]; then
useradd -M -s /usr/sbin/nologin www-data useradd -M -s /usr/sbin/nologin www-data
fi 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 ## create sites dir
mkdir -p /etc/caddy/sites mkdir -p /etc/caddy/sites

@ -10,7 +10,7 @@ none='\e[0m'
# Root # Root
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1
_version="v3.13" _version="v3.14"
cmd="apt-get" cmd="apt-get"

Loading…
Cancel
Save