mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
chore: make install and update scripts more agent-friendly (#2245)
The download was too verbose. This lead to the agent unable to read the whole output. It then made incorrect decisions on what to do next.
This commit is contained in:
parent
1d3f9ecd41
commit
0a36ebaf65
4 changed files with 26 additions and 12 deletions
|
|
@ -89,8 +89,15 @@ echo "Installing to: $INSTALL_DIR"
|
|||
mkdir -p "$INSTALL_DIR"
|
||||
cd "$INSTALL_DIR" || exit 1
|
||||
|
||||
# check bzip2 is available before downloading
|
||||
if ! command -v bzip2 > /dev/null 2>&1; then
|
||||
echo "❌ bzip2 is required but not installed. Run: sudo apt-get install -y bzip2" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# download and extract the Alby Hub executable
|
||||
if ! wget "$ALBYHUB_URL"; then
|
||||
echo "Downloading Alby Hub..."
|
||||
if ! wget -q "$ALBYHUB_URL"; then
|
||||
echo "❌ Failed to download Alby Hub package." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -111,7 +118,7 @@ if [ "$SKIP_VERIFY" = false ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if ! tar xvf server-linux-aarch64.tar.bz2; then
|
||||
if ! tar xf server-linux-aarch64.tar.bz2; then
|
||||
echo "Failed to unpack Alby Hub. Potentially bzip2 is missing"
|
||||
echo "Install it with sudo apt-get install bzip2"
|
||||
exit 1
|
||||
|
|
@ -133,7 +140,7 @@ chmod +x "$INSTALL_DIR/start.sh"
|
|||
|
||||
# add an update script to keep the Hub up to date
|
||||
# run this to update the hub
|
||||
wget https://raw.githubusercontent.com/getAlby/hub/master/scripts/linux-aarch64/update.sh
|
||||
wget -q https://raw.githubusercontent.com/getAlby/hub/master/scripts/linux-aarch64/update.sh
|
||||
chmod +x "$INSTALL_DIR/update.sh"
|
||||
|
||||
echo ""
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ mkdir albyhub-backup
|
|||
|
||||
echo "Creating current backup"
|
||||
if command -v rsync > /dev/null 2>&1; then
|
||||
rsync -av data bin lib albyhub-backup/
|
||||
rsync -a data bin lib albyhub-backup/
|
||||
else
|
||||
mv bin albyhub-backup
|
||||
mv lib albyhub-backup
|
||||
|
|
@ -118,7 +118,7 @@ fi
|
|||
|
||||
|
||||
echo "Downloading latest version"
|
||||
wget "$ALBYHUB_URL"
|
||||
wget -q "$ALBYHUB_URL"
|
||||
|
||||
if [ "$SKIP_VERIFY" = false ]; then
|
||||
if ! ./verify.sh server-linux-aarch64.tar.bz2 albyhub-Server-Linux-aarch64.tar.bz2; then
|
||||
|
|
@ -127,7 +127,7 @@ if [ "$SKIP_VERIFY" = false ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
tar -xvf server-linux-aarch64.tar.bz2
|
||||
tar -xf server-linux-aarch64.tar.bz2
|
||||
rm server-linux-aarch64.tar.bz2
|
||||
|
||||
if sudo systemctl list-units --type=service --all | grep -Fq albyhub.service; then
|
||||
|
|
|
|||
|
|
@ -89,8 +89,15 @@ echo "Installing to: $INSTALL_DIR"
|
|||
mkdir -p "$INSTALL_DIR"
|
||||
cd "$INSTALL_DIR" || exit 1
|
||||
|
||||
# check bzip2 is available before downloading
|
||||
if ! command -v bzip2 > /dev/null 2>&1; then
|
||||
echo "❌ bzip2 is required but not installed. Run: sudo apt-get install -y bzip2" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# download and extract the Alby Hub executable
|
||||
if ! wget "$ALBYHUB_URL"; then
|
||||
echo "Downloading Alby Hub..."
|
||||
if ! wget -q "$ALBYHUB_URL"; then
|
||||
echo "❌ Failed to download Alby Hub" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -111,7 +118,7 @@ if [ "$SKIP_VERIFY" = false ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if ! tar xvf server-linux-x86_64.tar.bz2; then
|
||||
if ! tar xf server-linux-x86_64.tar.bz2; then
|
||||
echo "Failed to unpack Alby Hub. Potentially bzip2 is missing"
|
||||
echo "Install it with sudo apt-get install bzip2"
|
||||
exit 1
|
||||
|
|
@ -133,7 +140,7 @@ chmod +x "$INSTALL_DIR/start.sh"
|
|||
|
||||
# add an update script to keep the Hub up to date
|
||||
# run this to update the hub
|
||||
wget https://raw.githubusercontent.com/getAlby/hub/master/scripts/linux-x86_64/update.sh
|
||||
wget -q https://raw.githubusercontent.com/getAlby/hub/master/scripts/linux-x86_64/update.sh
|
||||
chmod +x "$INSTALL_DIR/update.sh"
|
||||
|
||||
echo ""
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ mkdir albyhub-backup
|
|||
|
||||
echo "Creating current backup"
|
||||
if command -v rsync > /dev/null 2>&1; then
|
||||
rsync -av data bin lib albyhub-backup/
|
||||
rsync -a data bin lib albyhub-backup/
|
||||
else
|
||||
mv bin albyhub-backup
|
||||
mv lib albyhub-backup
|
||||
|
|
@ -118,7 +118,7 @@ fi
|
|||
|
||||
|
||||
echo "Downloading latest version"
|
||||
wget "$ALBYHUB_URL"
|
||||
wget -q "$ALBYHUB_URL"
|
||||
|
||||
if [ "$SKIP_VERIFY" = false ]; then
|
||||
if ! ./verify.sh server-linux-x86_64.tar.bz2 albyhub-Server-Linux-x86_64.tar.bz2; then
|
||||
|
|
@ -127,7 +127,7 @@ if [ "$SKIP_VERIFY" = false ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
tar -xvf server-linux-x86_64.tar.bz2
|
||||
tar -xf server-linux-x86_64.tar.bz2
|
||||
rm server-linux-x86_64.tar.bz2
|
||||
|
||||
if sudo systemctl list-units --type=service --all | grep -Fq albyhub.service; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue