mirror of
https://github.com/fankes/komari-agent.git
synced 2025-10-18 18:49:23 +08:00
feat: 添加对 FreeBSD 和 Windows 及 x86 的支持
This commit is contained in:
@@ -40,6 +40,7 @@ if ($GitHubProxy -ne '') { $ProxyDisplay = $GitHubProxy } else { $ProxyDisplay =
|
|||||||
switch ($env:PROCESSOR_ARCHITECTURE) {
|
switch ($env:PROCESSOR_ARCHITECTURE) {
|
||||||
'AMD64' { $arch = 'amd64' }
|
'AMD64' { $arch = 'amd64' }
|
||||||
'ARM64' { $arch = 'arm64' }
|
'ARM64' { $arch = 'arm64' }
|
||||||
|
'x86' { $arch = '386' }
|
||||||
Default { Log-Error "Unsupported architecture: $env:PROCESSOR_ARCHITECTURE"; exit 1 }
|
Default { Log-Error "Unsupported architecture: $env:PROCESSOR_ARCHITECTURE"; exit 1 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
39
install.sh
39
install.sh
@@ -57,6 +57,13 @@ case $os_type in
|
|||||||
Linux)
|
Linux)
|
||||||
os_name="linux"
|
os_name="linux"
|
||||||
;;
|
;;
|
||||||
|
FreeBSD)
|
||||||
|
os_name="freebsd"
|
||||||
|
;;
|
||||||
|
MINGW*|MSYS*|CYGWIN*)
|
||||||
|
os_name="windows"
|
||||||
|
target_dir="/c/komari" # Use C:\komari on Windows
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
log_error "Unsupported operating system: $os_type"
|
log_error "Unsupported operating system: $os_type"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -295,23 +302,45 @@ install_dependencies
|
|||||||
# Install vnstat if needed for month-rotate
|
# Install vnstat if needed for month-rotate
|
||||||
install_vnstat
|
install_vnstat
|
||||||
|
|
||||||
|
# Architecture detection with platform-specific support
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
case $arch in
|
case $arch in
|
||||||
x86_64)
|
x86_64)
|
||||||
arch="amd64"
|
arch="amd64"
|
||||||
;;
|
;;
|
||||||
aarch64)
|
aarch64|arm64)
|
||||||
arch="arm64"
|
arch="arm64"
|
||||||
;;
|
;;
|
||||||
arm64)
|
i386|i686)
|
||||||
arch="arm64"
|
# x86 (32-bit) support
|
||||||
|
case $os_name in
|
||||||
|
freebsd|linux|windows)
|
||||||
|
arch="386"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
log_error "Unsupported architecture: $arch"
|
log_error "32-bit x86 architecture not supported on $os_name"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
log_info "Detected architecture: ${GREEN}$arch${NC}"
|
;;
|
||||||
|
armv7*|armv6*)
|
||||||
|
# ARM 32-bit support
|
||||||
|
case $os_name in
|
||||||
|
freebsd|linux)
|
||||||
|
arch="arm"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
log_error "32-bit ARM architecture not supported on $os_name"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
log_error "Unsupported architecture: $arch on $os_name"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
log_info "Detected OS: ${GREEN}$os_name${NC}, Architecture: ${GREEN}$arch${NC}"
|
||||||
|
|
||||||
version_to_install="latest"
|
version_to_install="latest"
|
||||||
if [ -n "$install_version" ]; then
|
if [ -n "$install_version" ]; then
|
||||||
|
Reference in New Issue
Block a user