ares/.github/scripts/hoon/boot-ship.sh

35 lines
760 B
Bash
Raw Normal View History

2023-03-04 11:24:08 +03:00
#!/bin/bash
set -xeuo pipefail
PILL_NAME='solid.pill'
curl -L $URBIT_URL | tar xzk --transform='s/.*/urbit/g'
curl -L $PILL_URL -o $PILL_NAME
./urbit \
--bootstrap $PILL_NAME \
--local \
--lite-boot \
--daemon \
--fake bus \
-c $URBIT_PIER
LENS_PORT=$(grep 'loopback' $URBIT_PIER/.http.ports | awk -F ' ' '{print $1}')
lensecho() {
curl -s \
--data '{"source":{"data":"'"$1"'"},"sink":{"stdout":null}}' \
"http://localhost:$LENS_PORT" | xargs printf %s | sed 's/\\n//g'
}
check() {
[ "'3'" == "$(lensecho 3)" ]
}
if check; then
echo "boot success"
else
echo "boot failure"
exit 1
fi