copy systemd file from the package

pull/83/head
Kslr 2020-09-06 15:17:43 +08:00
parent 94ae72d399
commit 4706d8e46c
No known key found for this signature in database
GPG Key ID: 0AF5F66FA1E887CE
1 changed files with 0 additions and 35 deletions

View File

@ -380,41 +380,6 @@ install_v2ray() {
}
install_startup_service_file() {
"mkdir" -p "${TMP_DIRECTORY}/systemd/system/"
cat > "${TMP_DIRECTORY}/systemd/system/v2ray.service" <<-EOF
[Unit]
Description=V2Ray Service
After=network.target nss-lookup.target
[Service]
User=nobody
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
Environment=V2RAY_LOCATION_ASSET=/usr/local/share/v2ray/
ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
cat > "${TMP_DIRECTORY}/systemd/system/v2ray@.service" <<-EOF
[Unit]
Description=V2Ray Service
After=network.target nss-lookup.target
[Service]
User=nobody
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
Environment=V2RAY_LOCATION_ASSET=/usr/local/share/v2ray/
ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/%i.json
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
systemctl daemon-reload