Update systemd unit files every time the script is executed

脚本安装 systemd unit files 的行为很快会改为从最新的 v2ray-core release
中取得文件。
考虑到这些文件未来会有随 v2ray-core 新版本发布而更新的可能,所以提前做出这样的调整。
pull/81/head
IceCodeNew 2020-09-05 10:39:45 +08:00
parent 5d471592fd
commit 2235098bc6
1 changed files with 5 additions and 8 deletions

View File

@ -380,10 +380,8 @@ install_v2ray() {
} }
install_startup_service_file() { install_startup_service_file() {
if [[ ! -f '/etc/systemd/system/v2ray.service' ]]; then "mkdir" -p "${TMP_DIRECTORY}/systemd/system/"
"mkdir" -p "${TMP_DIRECTORY}/systemd/system/" cat > "${TMP_DIRECTORY}/systemd/system/v2ray.service" <<-EOF
install_software curl
cat > "${TMP_DIRECTORY}/systemd/system/v2ray.service" <<-EOF
[Unit] [Unit]
Description=V2Ray Service Description=V2Ray Service
After=network.target nss-lookup.target After=network.target nss-lookup.target
@ -417,10 +415,9 @@ Restart=on-failure
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
install -m 644 "${TMP_DIRECTORY}/systemd/system/v2ray.service" /etc/systemd/system/v2ray.service install -m 644 "${TMP_DIRECTORY}/systemd/system/v2ray.service" /etc/systemd/system/v2ray.service
install -m 644 "${TMP_DIRECTORY}/systemd/system/v2ray@.service" /etc/systemd/system/v2ray@.service install -m 644 "${TMP_DIRECTORY}/systemd/system/v2ray@.service" /etc/systemd/system/v2ray@.service
SYSTEMD='1' SYSTEMD='1'
fi
} }
start_v2ray() { start_v2ray() {