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