detect aarch64 periphery install

This commit is contained in:
mbecker20
2024-07-31 04:58:12 -07:00
parent 4238abf61a
commit 627f7ab585
2 changed files with 10 additions and 1 deletions

View File

@@ -2,6 +2,8 @@
*Note*. This script can be run multiple times without issue, and it won't change existing config after the first run. Just run it again after a Monitor version release, and it will update the periphery version.
*Note*. The script can usually detect aarch64 system and use the periphery-aarch64 binary.
There's two ways to install periphery: `System` and `User`
## System (requires root)

View File

@@ -1,5 +1,6 @@
import sys
import os
import platform
import json
import urllib.request
@@ -56,8 +57,14 @@ def copy_binary(user_install, bin_dir, version):
if os.path.isfile(bin_path):
os.remove(bin_path)
periphery_bin = "periphery"
arch = platform.machine().lower()
if arch == "aarch64" or arch == "amd64":
print("aarch64 detected")
periphery_bin = "periphery-aarch64"
# download the binary to bin path
print(os.popen(f'curl -sSL https://github.com/mbecker20/monitor/releases/download/{version}/periphery > {bin_path}').read())
print(os.popen(f'curl -sSL https://github.com/mbecker20/monitor/releases/download/{version}/{periphery_bin} > {bin_path}').read())
# add executable permissions
os.popen(f'chmod +x {bin_path}')