From 2235098bc68d553e5e9425915e049623cd5a2d36 Mon Sep 17 00:00:00 2001 From: IceCodeNew Date: Sat, 5 Sep 2020 10:39:45 +0800 Subject: [PATCH] Update systemd unit files every time the script is executed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 脚本安装 systemd unit files 的行为很快会改为从最新的 v2ray-core release 中取得文件。 考虑到这些文件未来会有随 v2ray-core 新版本发布而更新的可能,所以提前做出这样的调整。 --- install-release.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/install-release.sh b/install-release.sh index d2eff6c..ed8961e 100644 --- a/install-release.sh +++ b/install-release.sh @@ -380,10 +380,8 @@ install_v2ray() { } install_startup_service_file() { - if [[ ! -f '/etc/systemd/system/v2ray.service' ]]; then - "mkdir" -p "${TMP_DIRECTORY}/systemd/system/" - install_software curl - cat > "${TMP_DIRECTORY}/systemd/system/v2ray.service" <<-EOF + "mkdir" -p "${TMP_DIRECTORY}/systemd/system/" + cat > "${TMP_DIRECTORY}/systemd/system/v2ray.service" <<-EOF [Unit] Description=V2Ray Service After=network.target nss-lookup.target @@ -417,10 +415,9 @@ Restart=on-failure [Install] WantedBy=multi-user.target 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 - SYSTEMD='1' - fi + 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' } start_v2ray() {