mirror of
https://github.com/moghtech/komodo.git
synced 2026-04-28 19:59:46 -05:00
detect aarch64 periphery install
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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}')
|
||||
|
||||
Reference in New Issue
Block a user