mirror of
https://github.com/henrygd/beszel.git
synced 2026-03-25 06:56:17 +01:00
Compare commits
5 Commits
v0.12.12
...
f9a39c6004
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9a39c6004 | ||
|
|
f21a6d15fe | ||
|
|
bf38716095 | ||
|
|
45816e7de6 | ||
|
|
2a6946906e |
@@ -40,11 +40,12 @@ func (o *openRCRestarter) Restart() error {
|
||||
type openWRTRestarter struct{ cmd string }
|
||||
|
||||
func (w *openWRTRestarter) Restart() error {
|
||||
if err := exec.Command(w.cmd, "running", "beszel-agent").Run(); err != nil {
|
||||
// https://openwrt.org/docs/guide-user/base-system/managing_services?s[]=service
|
||||
if err := exec.Command("/etc/init.d/beszel-agent", "running").Run(); err != nil {
|
||||
return nil
|
||||
}
|
||||
ghupdate.ColorPrint(ghupdate.ColorYellow, "Restarting beszel-agent via procd…")
|
||||
return exec.Command(w.cmd, "restart", "beszel-agent").Run()
|
||||
return exec.Command("/etc/init.d/beszel-agent", "restart").Run()
|
||||
}
|
||||
|
||||
type freeBSDRestarter struct{ cmd string }
|
||||
@@ -64,11 +65,13 @@ func detectRestarter() restarter {
|
||||
if path, err := exec.LookPath("rc-service"); err == nil {
|
||||
return &openRCRestarter{cmd: path}
|
||||
}
|
||||
if path, err := exec.LookPath("procd"); err == nil {
|
||||
return &openWRTRestarter{cmd: path}
|
||||
}
|
||||
if path, err := exec.LookPath("service"); err == nil {
|
||||
if runtime.GOOS == "freebsd" {
|
||||
return &freeBSDRestarter{cmd: path}
|
||||
}
|
||||
return &openWRTRestarter{cmd: path}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<link rel="manifest" href="./static/manifest.json" />
|
||||
<link rel="icon" type="image/svg+xml" href="./static/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<title>Beszel</title>
|
||||
<script>
|
||||
globalThis.BESZEL = {
|
||||
|
||||
@@ -48,7 +48,7 @@ The [quick start guide](https://beszel.dev/guide/getting-started) and other docu
|
||||
- **Network usage** - Host system and containers.
|
||||
- **Load average** - Host system.
|
||||
- **Temperature** - Host system sensors.
|
||||
- **GPU usage / temperature / power draw** - Nvidia and AMD only. Must use binary agent.
|
||||
- **GPU usage / power draw** - Nvidia, AMD, and Intel.
|
||||
- **Battery** - Host system battery charge.
|
||||
|
||||
## Help and discussion
|
||||
|
||||
@@ -212,7 +212,6 @@ detect_mips_endianness() {
|
||||
PORT=45876
|
||||
UNINSTALL=false
|
||||
GITHUB_URL="https://github.com"
|
||||
GITHUB_API_URL="https://api.github.com" # not blocked in China currently
|
||||
GITHUB_PROXY_URL=""
|
||||
KEY=""
|
||||
TOKEN=""
|
||||
@@ -234,7 +233,7 @@ case "$1" in
|
||||
printf " -u : Uninstall Beszel Agent\n"
|
||||
printf " --auto-update [VALUE] : Control automatic daily updates\n"
|
||||
printf " VALUE can be true (enable) or false (disable). If not specified, will prompt.\n"
|
||||
printf " --china-mirrors [URL] : Use GitHub proxy to resolve network timeout issues in mainland China\n"
|
||||
printf " --mirror [URL] : Use GitHub proxy to resolve network timeout issues in mainland China\n"
|
||||
printf " URL: optional custom proxy URL (default: https://gh.beszel.dev)\n"
|
||||
printf " -h, --help : Display this help message\n"
|
||||
exit 0
|
||||
@@ -293,7 +292,7 @@ while [ $# -gt 0 ]; do
|
||||
-u)
|
||||
UNINSTALL=true
|
||||
;;
|
||||
--china-mirrors*)
|
||||
--mirror* | --china-mirrors*)
|
||||
# Check if there's a value after the = sign
|
||||
if echo "$1" | grep -q "="; then
|
||||
# Extract the value after =
|
||||
@@ -452,18 +451,6 @@ if [ "$UNINSTALL" = true ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Confirm the use of GitHub mirrors for downloads
|
||||
if [ -n "$GITHUB_PROXY_URL" ]; then
|
||||
printf "\nConfirm use of GitHub mirror (%s) for downloading beszel-agent?\nThis helps to install properly in mainland China. (Y/n): " "$GITHUB_PROXY_URL"
|
||||
read USE_MIRROR
|
||||
USE_MIRROR=${USE_MIRROR:-Y}
|
||||
if [ "$USE_MIRROR" = "Y" ] || [ "$USE_MIRROR" = "y" ]; then
|
||||
echo "Using GitHub Mirror ($GITHUB_PROXY_URL) for downloads..."
|
||||
else
|
||||
GITHUB_URL="https://github.com"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if a package is installed
|
||||
package_installed() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
@@ -608,7 +595,12 @@ FILE_NAME="beszel-agent_${OS}_${ARCH}.tar.gz"
|
||||
|
||||
# Determine version to install
|
||||
if [ "$VERSION" = "latest" ]; then
|
||||
INSTALL_VERSION=$(curl -s "$GITHUB_API_URL""/repos/henrygd/beszel/releases/latest" | grep -o '"tag_name": "v[^"]*"' | cut -d'"' -f4 | tr -d 'v')
|
||||
INSTALL_VERSION=$(curl -s "https://get.beszel.dev/latest-version")
|
||||
if [ -z "$INSTALL_VERSION" ]; then
|
||||
# Fallback to GitHub API
|
||||
API_RELEASE_URL="https://api.github.com/repos/henrygd/beszel/releases/latest"
|
||||
INSTALL_VERSION=$(curl -s "$API_RELEASE_URL" | grep -o '"tag_name": "v[^"]*"' | cut -d'"' -f4 | tr -d 'v')
|
||||
fi
|
||||
if [ -z "$INSTALL_VERSION" ]; then
|
||||
echo "Failed to get latest version"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user