Files: b42712bfb57c4f7d0d82f9add942f8d13b310ed5 / prelude / install.sh
717 bytesRaw
1 | |
2 | { |
3 | blobs_base=${SSB_BLOBS_BASE:-http://localhost:8989/blobs/get/} |
4 | |
5 | system=$(uname -sm) || return 1 |
6 | case "$system" in |
7 | %SWITCH_NODE_BLOBS% |
8 | *) |
9 | printf 'System not recognized: %s\n' "$system" >&2 |
10 | exit 1 |
11 | ;; |
12 | esac |
13 | |
14 | install_js_blob='%INSTALL_JS_BLOB%' |
15 | exec 3<<EOF |
16 | %SETTINGS% |
17 | EOF |
18 | |
19 | tmp_dir=$(mktemp -d "${TMPDIR:-/tmp}/ssb-pkg.XXXXXXXXX") || return 1 |
20 | node_bin="$tmp_dir/ssb-pkg-node-$$" |
21 | install_js="$tmp_dir/ssb-pkg-install-$$" |
22 | |
23 | while ! for id; do |
24 | echo "$id" >&2 |
25 | curl -sS "$blobs_base$id" |
26 | done | gunzip > "$node_bin"; do sleep 2; done |
27 | chmod +x "$node_bin" |
28 | |
29 | while ! curl -sS "$blobs_base$install_js_blob" -o "$install_js" |
30 | do sleep 1; done |
31 | "$node_bin" "$install_js" |
32 | rc=$? |
33 | rm -rf "$tmp_dir" |
34 | return $rc |
35 | } |
36 |
Built with git-ssb-web