Skip to content

Commit d3a54bc

Browse files
authored
Fix cpu architecture compatibility with b2 host (hestiacp#2394)
* Fix cpu architecture compatibility with b2 host Add check for cpu architecture and use the python b2 package instead of Github for arm64 architecture as the GitHub version doesn't exist and will produce an error. * Add check if pip3 exists If pip3 doesn't exit install python3-pip * change arm cpu architecture handing - change the way the script handles servers with ARM cpus, from downloading using pip3, to returning an error requesting the user solve this using manual action.
1 parent 88b3275 commit d3a54bc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

bin/v-add-backup-host

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ password=$(perl -e 'print quotemeta shift(@ARGV)' "${raw_password}")
2020
path=${5-/backup}
2121
port=$6
2222

23+
# CPU Architecture
24+
arch=$(uname -m)
25+
2326
# Includes
2427
# shellcheck source=/usr/local/hestia/func/main.sh
2528
source $HESTIA/func/main.sh
@@ -188,8 +191,13 @@ fi
188191
if [ "$type" = 'b2' ]; then
189192
# Download b2 binary
190193
if [ ! -f "$b2cli" ]; then
191-
wget -O $b2cli $b2lnk > /dev/null 2>&1
192-
chmod +x $b2cli > /dev/null 2>&1
194+
if [ "$arch" = 'aarch64' ] || [ "$arch" = 'arm64' ]; then
195+
echo "Error: B2 binary for arm64 must be downloaded manually."
196+
exit 3
197+
else
198+
wget -O $b2cli $b2lnk > /dev/null 2>&1
199+
chmod +x $b2cli > /dev/null 2>&1
200+
fi
193201
if [ ! -f "$b2cli" ]; then
194202
echo "Error: Binary download failed, b2 doesnt work as expected."
195203
exit 3

0 commit comments

Comments
 (0)