#!/bin/bash

set -o pipefail

setman-log notice "lwr-isc backup started"
/usr/bin/timeout 30 sh -c 'while ! ss -H -t -l -n sport = :8000 | grep -q "^LISTEN.*:8000"; do sleep 1; done'
setman-log notice "lwr-isc backup: '/usr/bin/timeout' returned with value $?"

curl --silent --fail http://localhost:8000/lara/api/configuration | setman-backup "laraConfiguration" isc_config.zip
