mirror of
https://github.com/wnlen/clash-for-linux.git
synced 2026-03-21 22:06:45 +08:00
script
This commit is contained in:
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
LOG_FILE="$PROJECT_DIR/logs/clash.log"
|
||||
SERVICE_NAME="clash-for-linux.service"
|
||||
|
||||
if [ "${1:-}" = "-f" ]; then
|
||||
if command -v journalctl >/dev/null 2>&1; then
|
||||
journalctl -u "$SERVICE_NAME" -f
|
||||
else
|
||||
tail -f "$LOG_FILE"
|
||||
fi
|
||||
else
|
||||
if command -v journalctl >/dev/null 2>&1; then
|
||||
journalctl -u "$SERVICE_NAME" -n 50 --no-pager
|
||||
else
|
||||
tail -n 50 "$LOG_FILE"
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user