aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/Crupest.V2ray/tools/cru-proxy-edit (renamed from tools/Crupest.V2ray/tools/cru-edit-proxy)2
-rwxr-xr-xtools/Crupest.V2ray/tools/cru-proxy-log (renamed from tools/Crupest.V2ray/tools/cru-log-proxy)5
-rw-r--r--tools/Crupest.V2ray/tools/life.crupest.v2ray.plist18
3 files changed, 23 insertions, 2 deletions
diff --git a/tools/Crupest.V2ray/tools/cru-edit-proxy b/tools/Crupest.V2ray/tools/cru-proxy-edit
index a492ea1..9ba6cbc 100755
--- a/tools/Crupest.V2ray/tools/cru-edit-proxy
+++ b/tools/Crupest.V2ray/tools/cru-proxy-edit
@@ -5,7 +5,7 @@ set -e
p="$HOME/codes/crupest/tools/Crupest.V2ray/publish/proxy.txt"
if [[ ! -f "$p" ]]; then
- echo "File $p does not exist!"
+ echo "File $p does not exist!" >&2
exit 1
fi
diff --git a/tools/Crupest.V2ray/tools/cru-log-proxy b/tools/Crupest.V2ray/tools/cru-proxy-log
index 98f1bef..0ac800c 100755
--- a/tools/Crupest.V2ray/tools/cru-log-proxy
+++ b/tools/Crupest.V2ray/tools/cru-proxy-log
@@ -5,6 +5,9 @@ set -e
if [[ -e /proc ]]; then
# I don't believe your system is Linux but there is no /proc.
exec journalctl --user -u crupest-v2ray "$@"
+elif [[ "$(uname)" == "Darwin" ]]; then
+ exec less "$HOME/.local/state/Crupest.V2ray/log"
else
- echo "Not supported on systems other than Linux now." >&2
+ echo "Not supported on systems other than macOS and Linux now." >&2
+ exit 1
fi
diff --git a/tools/Crupest.V2ray/tools/life.crupest.v2ray.plist b/tools/Crupest.V2ray/tools/life.crupest.v2ray.plist
new file mode 100644
index 0000000..4569ae2
--- /dev/null
+++ b/tools/Crupest.V2ray/tools/life.crupest.v2ray.plist
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>life.crupest.v2ray</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>/Users/crupest/.local/bin/Crupest.V2ray</string>
+ </array>
+ <key>KeepAlive</key>
+ <true/>
+ <key>StandardOutPath</key>
+ <string>/Users/crupest/.local/state/Crupest.V2ray/log</string>
+ <key>StandardErrorPath</key>
+ <string>/Users/crupest/.local/state/Crupest.V2ray/error</string>
+</dict>
+</plist>