Check if an update is available for the 3x-ui panel by comparing the installed version with the latest GitHub release.
Find a file
2026-05-20 20:19:52 +08:00
.gitignore Add initial commit with 3x-ui update check script 2026-05-03 21:12:29 +08:00
3x-ui-update-check Bump version to 1.5.1 2026-05-20 20:19:52 +08:00
AGENTS.md Updated AGENTS.md with the latest version for shell scripts. 2026-05-20 20:18:39 +08:00
CLAUDE.md Add initial commit with 3x-ui update check script 2026-05-03 21:12:29 +08:00
LICENSE Add initial commit with 3x-ui update check script 2026-05-03 21:12:29 +08:00
README.md Add xray-core version checking 2026-05-07 22:23:05 +08:00

3x-ui-update-check

Compares the installed 3x-ui panel and xray-core versions against the latest GitHub releases and reports whether updates are available. When a newer version is found, a link to the GitHub release notes is provided.

The xray check is non-fatal: if the xray binary cannot be found or its version cannot be determined, a warning is logged and the panel check proceeds independently.

Requirements

  • bash
  • curl
  • jq
  • 3x-ui installed at /usr/local/x-ui/x-ui
  • xray-core installed under /usr/local/x-ui/bin/ (auto-detected; override with --xray-path)

Installation

Ensure ~/.local/bin is in your PATH, then run:

mkdir -p ~/.local/bin && curl -fsSL https://code.paulg.it/paulgit/3x-ui-update-check/raw/branch/main/3x-ui-update-check -o ~/.local/bin/3x-ui-update-check && chmod 755 ~/.local/bin/3x-ui-update-check

Usage

3x-ui-update-check [OPTIONS]

Options:
  -h, --help      Show help and exit.
  -V, --version   Show version and exit.
  --cronmode      Suppress output when no update is available.
                  Only errors and update notifications are shown.
  --every N       Throttle update notifications to once every N runs.
                  A new version always triggers an immediate notification
                  regardless of N. Implies --cronmode.
  --xray-path P   Path to the xray binary (default: auto-detect in
                  /usr/local/x-ui/bin).

Throttling with --every is applied per-component. Each of 3x-ui and xray-core maintains its own throttle counter, so a new version of one does not affect the notification schedule of the other.

Examples

Check for updates interactively:

3x-ui-update-check

Run daily from cron, sending a notification at most once a week:

# Add to your crontab with: crontab -e
0 8 * * * /home/paulh/.local/bin/3x-ui-update-check --every 7

Use a custom xray binary path:

3x-ui-update-check --xray-path /opt/xray/xray

A new version always triggers a notification on the day it is detected. After that, reminders follow every N runs (e.g. weekly for a daily cron job with --every 7).

License

WTFPL