|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 4 | +# SPDX-License-Identifier: Apache-2.0 |
| 5 | + |
| 6 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +# you may not use this file except in compliance with the License. |
| 8 | +# You may obtain a copy of the License at |
| 9 | + |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + |
| 12 | +# Unless required by applicable law or agreed to in writing, software |
| 13 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +# See the License for the specific language governing permissions and |
| 16 | +# limitations under the License. |
| 17 | + |
| 18 | +set -e |
| 19 | + |
| 20 | +VERSION=3.3.2 |
| 21 | +PLATFORM=amd64 |
| 22 | +OS_VERSION=$(lsb_release -rs) |
| 23 | + |
| 24 | +# ---- Install Haply Inverse Service |
| 25 | +if command -v "haply-inverse-service" &> /dev/null; then |
| 26 | + echo "Haply Inverse Service already installed, skipping." |
| 27 | + exit 0 |
| 28 | +fi |
| 29 | + |
| 30 | +if [[ "$(uname -m)" != x86_64 ]]; then |
| 31 | + echo "Skipping for non-x86_64 arch." |
| 32 | + exit 1 |
| 33 | +fi |
| 34 | + |
| 35 | +# Download the deb package |
| 36 | +if [[ "$OS_VERSION" == "24.04" ]]; then |
| 37 | + echo "Detected Ubuntu 24.04" |
| 38 | + wget -O haply-inverse-service.deb https://cdn.haply.co/r/38736259/haply-inverse-service_3.3.2_amd64.deb |
| 39 | +elif [[ "$OS_VERSION" == "22.04" ]]; then |
| 40 | + echo "Detected Ubuntu 22.04" |
| 41 | + wget -O haply-inverse-service.deb https://cdn.haply.co/r/38736259/haply-inverse-service_3.3.2_2204_amd64.deb |
| 42 | +else |
| 43 | + echo "Unsupported version of Ubuntu: $OS_VERSION" |
| 44 | + exit 1 |
| 45 | +fi |
| 46 | + |
| 47 | + |
| 48 | +# Install debian |
| 49 | +sudo apt-get install -y ./haply-inverse-service.deb |
| 50 | +rm haply-inverse-service.deb |
| 51 | + |
| 52 | +echo "Haply Inverse Service installed!" |
0 commit comments