install.sh
AArch64 (ARM64) architecture stringReferences curl flags and HTTP URL
SHA-2562a608d8021dd765806ce7c57b648c10faa3ae673de65378b0275d09a7c51d7e3
Evidence
1#!/bin/sh
2# SPDX-License-Identifier: LicenseRef-Reticulum
3# Copyright (c) 2024-2026 Quad4.io
4#
5# Install reticulum-go from a GitHub release binary or by building source.
6#
7# Curl:
8# curl -fsSL https://git.quad4.io/reticulum/Reticulum-Go/raw/branch/master/install.sh | sh
9# curl -fsSL https://git.quad4.io/reticulum/Reticulum-Go/raw/branch/master/install.sh | sh -s -- --dry-run
10# curl -fsSL https://git.quad4.io/reticulum/Reticulum-Go/raw/branch/master/install.sh | sh -s -- --source
11#
12# Checkout:
13# ./install.sh
14# ./install.sh --dry-run
15# ./install.sh --source --init systemd
16#
17# shellcheck shell=sh
18
19set -eu
20
21REPO="${RGO_REPO:-Quad4-Software/Reticulum-Go}"
22GITHUB="${RGO_GITHUB:-https://github.com}"
23GITHUB_API="${RGO_GITHUB_API:-https://api.github.com}"
24GITHUB_RAW="${RGO_GITHUB_RAW:-https://raw.githubusercontent.com}"
25MIN_GO="${RGO_MIN_GO:-1.27.4}"
26BINARY_NAME="reticulum-go"
27STATE_DIR="/var/lib/reticulum-go"
28TOOL_LINKS="rgostatus rgoid rgoprobe rgopath rgocp rgox rnx rgosh rgopageserver rgoslow rgoselfcheck rgospeed rgodump rgosnap rgozen"
29
30PREFIX="${PREFIX:-/usr/local}"
31DESTDIR="${DESTDIR:-}"
32BINDIR="${BINDIR:-}"
33INIT="${INIT:-auto}"
34TAG="${RGO_VERSION:-${VERSION:-latest}}"
35METHOD="${RGO_METHOD:-}"
36SERVIC …
61:11… nstall.sh: %s\n' "$*" >&2
62}
63
64die() {
65 err "$*"
66 exit 1
67}
68
69usage() {
70 cat <<'EOF'
71Usage: install.sh [options]
72
73Install reticulum-go (release binary or build from source) and optional
74init service files (systemd, OpenRC, runit, or dinit).
75
76Options:
77 --binary …
87:44… latest, or RGO_VERSION)
88 --goamd64 LEVEL auto|v1|v3 (linux/amd64 microarchitecture)
89 --verify Require cosign attestation (needs cosign)
90 --no-verify Skip cosign even if it …
96:11… ICE RGO_GOAMD64 RGO_VERIFY RGO_GITHUB RGO_GITHUB_API
97
98Examples:
99 curl -fsSL https://git.quad4.io/reticulum/Reticulum-Go/raw/branch/master/install.sh | sh
100 curl -fsSL https://git.quad4.io/reticulum/Reticulum-Go/raw/branch/master/install.sh | sh -s -- --dry-run
101 ./install.sh --source --init runit
102EOF
103}
104
105cleanup() {
106 if [ -n "$WORK_DIR" ] && [ -d "$WORK_DIR" ]; then
107 rm -rf "$WORK_DIR"
108 fi
109}
110
111trap cleanup EXIT INT HUP TERM
112
113is_checkout() {
114 root="$1"
115 [ -n "$root" ] || return 1
116 [ -f "$root/go.mod" ] || return 1
117 [ -d "$root/cmd/reticulum-go" ] || return 1
118 [ -d "$root/packaging" ] || return …
122:3… cript="$0"
123 case "$script" in
124 -|sh|dash|bash|ksh|*/sh|*/dash|*/bash)
125 return 1
126 ;;
127 esac
128 if [ ! -f "$script" ]; then
129 return 1
130 fi
131 dir=$(CDPATH='' cd -- "$(dirname "$script")" && pwd)
132 if is_checkout "$dir"; then
133 CHECKOUT_ROOT="$dir"
134 return 0
135 fi
136 return 1
137}
138
139has_tty() {
140 [ -r /dev/tty ] && [ -w /dev/tty ]
141}
142
⋯4 lines