Skip to content

Commit

Permalink
added support for older OS versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Eshanchik committed Oct 24, 2024
1 parent 2053243 commit 01d5a72
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ if [ -f /etc/debian_version ]; then
DISTRO=$(lsb_release -is)
if [[ "$DISTRO" == "Debian" ]]; then

if [ ! -d "/etc/apt/keyrings" ]; then
sudo mkdir -p /etc/apt/keyrings
fi

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
Expand All @@ -31,6 +35,10 @@ if [ -f /etc/debian_version ]; then

elif [[ "$DISTRO" == "Ubuntu" ]]; then

if [ ! -d "/etc/apt/keyrings" ]; then
sudo mkdir -p /etc/apt/keyrings
fi

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
Expand Down Expand Up @@ -59,8 +67,17 @@ chmod +x update.sh
./update.sh

LATEST_TAG=$(curl -s https://api.github.com/repos/ambrosus/airdao-nop-rs/releases/latest | jq -r .tag_name)
DEBIAN_VERSION=$(lsb_release -sr)
UBUNTU_VERSION=$(lsb_release -sr)

if (( $(echo "$DEBIAN_VERSION > 11" | bc -l) )) || (( $(echo "$UBUNTU_VERSION >= 22" | bc -l) )); then
FILE_URL="https://github.com/ambrosus/airdao-nop-rs/releases/download/$LATEST_TAG/airdao-nop-rs-x86-64.zip"
else
FILE_URL="https://github.com/ambrosus/airdao-nop-rs/releases/download/$LATEST_TAG/airdao-nop-rs-x86-64-old.zip"
fi

curl -L -o airdao-nop-release.zip "$FILE_URL"

curl -L -o airdao-nop-release.zip https://github.com/ambrosus/airdao-nop-rs/releases/download/$LATEST_TAG/airdao-nop-rs-ubuntu.zip
unzip airdao-nop-release.zip
rm airdao-nop-release.zip
chmod +x ./airdao-nop-rs
Expand Down

0 comments on commit 01d5a72

Please sign in to comment.