vere/docker/reset_urbit_code.sh
Peter McEvoy 98cbc349cf
Achieve feature parity with v1.15 and earlier Docker images (#123)
Co-authored-by: Peter McEvoy <git@mcevoypeter.com>
2023-01-18 12:24:52 -05:00

17 lines
567 B
Bash
Executable File

#!/bin/bash
# Sending `+hood/code %reset` to `dojo` resets the `+code`, but it requires
# interactive confirmation to do so. Obviously, we don't want to have to provide
# that confirmation, so we force reset the `+code` using
# `+hood/pass [%j %step ~]`, credit for which goes to ~wicdev-wisryt.
resp=$(curl -s -X POST -H "Content-Type: application/json" \
-d '{ "source": { "dojo": "+hood/pass [%j %step ~]" }, "sink": { "app": "hood" } }' \
http://127.0.0.1:12321)
if [[ $? -eq 0 ]]
then
echo "OK"
else
echo "Curl error: $?"
fi