|
|
@ -705,18 +705,26 @@ install_caddy() { |
|
|
|
echo -e "$red 安装 Caddy 出错!" && exit 1 |
|
|
|
echo -e "$red 安装 Caddy 出错!" && exit 1 |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/caddy |
|
|
|
|
|
|
|
|
|
|
|
if [[ $systemd ]]; then |
|
|
|
if [[ $systemd ]]; then |
|
|
|
cp -f ${caddy_tmp}init/linux-systemd/caddy.service /lib/systemd/system/ |
|
|
|
cp -f ${caddy_tmp}init/linux-systemd/caddy.service /lib/systemd/system/ |
|
|
|
sed -i "s/www-data/root/g" /lib/systemd/system/caddy.service |
|
|
|
# sed -i "s/www-data/root/g" /lib/systemd/system/caddy.service |
|
|
|
systemctl enable caddy |
|
|
|
systemctl enable caddy |
|
|
|
else |
|
|
|
else |
|
|
|
cp -f ${caddy_tmp}init/linux-sysvinit/caddy /etc/init.d/caddy |
|
|
|
cp -f ${caddy_tmp}init/linux-sysvinit/caddy /etc/init.d/caddy |
|
|
|
sed -i "s/www-data/root/g" /etc/init.d/caddy |
|
|
|
# sed -i "s/www-data/root/g" /etc/init.d/caddy |
|
|
|
chmod +x /etc/init.d/caddy |
|
|
|
chmod +x /etc/init.d/caddy |
|
|
|
update-rc.d -f caddy defaults |
|
|
|
update-rc.d -f caddy defaults |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
mkdir -p /etc/ssl/caddy |
|
|
|
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 |
|
|
|
|
|
|
|
|
|
|
|
mkdir -p /etc/caddy/ |
|
|
|
mkdir -p /etc/caddy/ |
|
|
|
rm -rf $caddy_tmp |
|
|
|
rm -rf $caddy_tmp |
|
|
|
caddy_config |
|
|
|
caddy_config |
|
|
@ -761,9 +769,9 @@ install_v2ray() { |
|
|
|
# $cmd install -y lrzsz git zip unzip curl wget qrencode bind-utils iptables-services |
|
|
|
# $cmd install -y lrzsz git zip unzip curl wget qrencode bind-utils iptables-services |
|
|
|
# fi |
|
|
|
# fi |
|
|
|
if [[ $cmd == "apt-get" ]]; then |
|
|
|
if [[ $cmd == "apt-get" ]]; then |
|
|
|
$cmd install -y lrzsz git zip unzip curl wget qrencode |
|
|
|
$cmd install -y lrzsz git zip unzip curl wget qrencode libcap2-bin |
|
|
|
else |
|
|
|
else |
|
|
|
$cmd install -y lrzsz git zip unzip curl wget qrencode iptables-services |
|
|
|
$cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services |
|
|
|
fi |
|
|
|
fi |
|
|
|
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
|
|
|
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
|
|
|
|
|
|
|
|
|
|
|