#!/bin/bash
cd "$(dirname "$0")/.."

flag="storage/app/monitor/horizon-restart-requested.txt"
witness="storage/app/monitor/horizon_restarted_$(date +%Y%m%d_%H%M%S).txt"

if [ -f "$flag" ]
then
    rm ${flag}
    touch ${witness}
    ./sku horizon:terminate
fi
