#!/bin/sh # make sure script does not hang forever if [ -z "$1" ]; then exec timeout -k 60 120 $0 timeout fi set -e printf "=== config ===\n" booth-keygen cat <&1 boothd daemon -D -s 127.0.0.3 2>&1 printf "\n=== status ===\n" for i in `seq 1 60`; do if booth status; then break fi sleep 1 done booth list printf "\n=== grant ===\n" booth grant ticket-A 2>&1 booth list printf "\n=== revoke ===\n" booth revoke ticket-A 2>&1 booth list printf "\n=== geostore ===\n" geostore set status GOOD 2>&1 geostore get status geostore list geostore delete status printf "\n=== authkey2 ===\n" booth-keygen /etc/booth/authkey2 sed 's/authkey/authkey2/' < /etc/booth/booth.conf > /etc/booth/booth.conf2 if booth list -c /etc/booth/booth.conf2 2>&1; then echo authkey2 should fail to authenticate exit 1 fi