diff --git a/release/config/systemd/v2ray.service b/release/config/systemd/v2ray.service index 8895e2d7e..255944a9d 100644 --- a/release/config/systemd/v2ray.service +++ b/release/config/systemd/v2ray.service @@ -16,7 +16,7 @@ Restart=on-failure RestartPreventExitStatus=23 # Configuration error # After unexpected exit, upload latest V2Ray log to official log service for future analysis. # Comment out the following line if you have privacy concerns. -ExecStopPost=journalctl -u v2ray --since today | curl -X PUT --upload-file "-" https://transfer.sh/v2ray.log | awk '{print "{\"value1\":\""$1"\"}"}' | curl --header "Content-Type: application/json" --request POST --data @- https://www.v2ray.com/logupload/ +ExecStopPost=/usr/bin/v2ray/upload.sh [Install] WantedBy=multi-user.target diff --git a/release/config/upload.sh b/release/config/upload.sh new file mode 100644 index 000000000..fac663265 --- /dev/null +++ b/release/config/upload.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +journalctl -u v2ray --since today | curl -X PUT -s --upload-file "-" https://transfer.sh/v2ray.log | awk '{print "{\"value1\":\""$1"\"}"}' | curl -s --header "Content-Type: application/json" --request POST --data @- https://www.v2ray.com/logupload/ diff --git a/release/install-release.sh b/release/install-release.sh index bc1446bff..bfe70fba4 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -245,6 +245,7 @@ installV2Ray(){ copyFile v2ctl && makeExecutable v2ctl copyFile geoip.dat copyFile geosite.dat + copyFile upload.sh && makeExecutable upload.sh # Install V2Ray server config to /etc/v2ray if [[ ! -f "/etc/v2ray/config.json" ]]; then