Benign linux Download

install

AArch64 (ARM64) architecture stringReferences a systemd ExecStart directive
SHA-25623af9811e1172a11a1baabda0fac148075a30ea148025298360226c9c466d260

Evidence

Usage: help text marker lines 17–22
17:64… e machine
18# that lives on the edge
19#
20# Usage:
21# ./install # build + install the latest release tag
22# ./install --edge # build + install the latest main …
References a release download URL path lines 26–73
26:53… DING state
27
28set -euo pipefail
29
30XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
31XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
32XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
33HUM_CONFIG="$XDG_CONFIG_HOME/hum"
34HUM_DATA="$XDG_DATA_HOME/hum"
35HUM_STATE="$XDG_STATE_HOME/hum"
36HUM_BIN_ROOT="$HOME/.local"
37HUMD_BIN="$HUM_BIN_ROOT/bin/humd"
38HUMCTL_BIN="$HUM_BIN_ROOT/bin/humctl"
39HUM_CLI_BIN="$HUM_BIN_ROOT/bin/hum"
40ORCHD_BIN="$HUM_BIN_ROOT/bin/orchd"
41
42HUM_REPO_URL="${HUM_REPO_URL:-https://github.com/adiled/hum.git}"
43HUM_SRC="$HUM_DATA/src"
44
45ORCHD_MIN_VERSION="0.5.0"
46ORCHD_MAX_VERSION="0.5.0"
47ORCHD_RELEASES="${ORCHD_DOWNLOAD_URL:-https://github.com/adiled/orchd/releases/download/v$ORCHD_MIN_VERSION}"
48
49EDGE=0
50declare -a REST=()
51for arg in "$@"; do
52 case "$arg" in
53 --edge) EDGE=1 ;;
54 -h|--help) sed -n '2,24p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
55 *) REST+=("$arg") ;;
56 esac
57done
58CMD="${REST[0]:-install}"
59OS="$(uname -s)"
60
61log() { printf '\033[1m[hum]\033[0m %s\n' "$*"; }
62warn() { printf '\033[1;33m[hum]\033[0m %s\n' "$*" >&2; }
63fail() { printf '\033[1;31m[hum]\033[0m %s\n' "$*" >&2; exit 1; }
64
65version_gte() { printf '%s\n%s\n' "$2" "$1" | sort -V -C; }
66read_version() { "$1" --version 2>/dev/null | sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/p' | head -1; }
67
68ensure_min_version() {
69 local NAME="$1" BIN="$2" MIN="$3"
70 if ! command -v "$BIN" >/dev/null 2>&1; then fail "$NAME not found on PATH."; fi
71 local CUR; CUR="$(read_version "$BIN" || true)"
72 if [ -z "$CUR" ]; then fail "$NAME found but couldn't read version."; fi
73 if version_gte "$CUR" "$MIN"; then log "$NAME ${C …
Shell command-substitution syntax lines 75–84
75:2…
76
77ensure_orchd_api() {
78 local BIN="$1" HELP MISSING=""
79 HELP="$("$BIN" --help 2>/dev/null || true)"
80 for sub in grow survey fell logs; do
81 printf '%s' "$HELP" | grep -Eq "^ +${sub}( |$)" || MISSING="$MISSING $sub"
82 done
83 if [ -n "$MISSING" ]; then
84 fail "orchd is missing the subcommand(s …
HTTP or HTTPS URL reference lines 95–142
⋯4 lines
99
100ensure_identity() {
101 mkdir -p "$HUM_STATE"
102 local KEY="$HUM_STATE/humd.key"
103 if [ -s "$KEY" ]; then log "humd identity: $KEY ✓"; return 0; fi
104 log "minting humd identity at $KEY"
105 dd if=/dev/urandom of="$KEY" bs=32 count=1 2>/dev/null
106 chmod 600 "$KEY"
107}
108
109ensure_peers_config() {
110 mkdir -p "$HUM_CONFIG"
111 local PEERS="$HUM_CONFIG/peers.json"
112 if [ -s "$PEERS" ]; then log "peers.json: $PEERS ✓"; return 0; fi
113 echo "[]" > "$PEERS"
114 log "wrote empty peers.json at $PEERS"
115}
116
117ensure_hum_config() {
118 mkdir -p "$HUM_CONFIG"
119 local CFG="$HUM_CONFIG/hum.json"
120 if [ -s "$CFG" ]; then log "hum.json: $CFG ✓"; return 0; fi
121 cat > "$CFG" <<JSON
122{
123 "\$schema": "https://adiled.github.io/hum/hum.schema.json",
124 "fs": {
125 "roots": [
126 { "path": "~/code", "mode": "rw" },
127 { "path": "/tmp", "mode": "rw" }
128 ],
129 "denied": ["~/.ssh", "~/.aws", "~/.gnupg", "~/.config/hum"]
130 }
131}
⋯4 lines
136install_man_page() {
137 local PAGE
138 for PAGE in "$(dirname "$0")/man/hum.1" "$HUM_SRC/man/hum.1"; do
139 [ -f "$PAGE" ] || continue
140 local DIR
141 for DIR in /usr/local/share/man "$XDG_DATA_HOME/man"; do
142 if mkdir -p "$DIR/man1" 2>/dev/null && cp "$PAGE" "$DIR/man1/hum.1" 2>/dev/null; then
Shell changes working directory lines 154–161
154:48… p -q '"humd"' "$(dirname "$0")/Cargo.toml"; then
155 LOCAL_SRC="$(cd "$(dirname "$0")" && pwd)"
156 fi
157
158 if [ "$MODE" = edge ] && [ -n "$LOCAL_SRC" ]; then
159 local BRANCH; BRANCH="$(git -C "$LOCAL_SRC" rev-parse --abbrev-ref HEAD 2>/dev/null || echo '?')"
160 if [ "$BRANCH" != "main" ]; then
161 fail "--edge builds main HEAD, but $LOCAL_SRC is on '$BRANCH'. Check out main, or d …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.