#! /bin/sh

die() { echo "$*" >&2 ; exit 1; }

set -x
set -e
test -n "$RESALLOC_NAME"
test -n "$RESALLOC_RESOURCE_DATA"

# we only put IP out in spawning script, nothing else
set -- $(echo "$RESALLOC_RESOURCE_DATA" | base64 --decode)
IP=$1
ssh -o ConnectTimeout=10 "root@$IP" copr-builder-cleanup
