Files: e1a1630f31c55420ca08a2a8e36296e3c202f1b1 / prelude / install.sh
700 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 | rm -rf "$tmp_dir" |
33 | } |
34 |
Built with git-ssb-web