git ssb

0+

cel-desktop / ssb-pkg



Tree: b42712bfb57c4f7d0d82f9add942f8d13b310ed5

Files: b42712bfb57c4f7d0d82f9add942f8d13b310ed5 / prelude / install.sh

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

Built with git-ssb-web