From 32acfae2a31039fe8238140e56e0937d1994cdf4 Mon Sep 17 00:00:00 2001 From: duke Date: Sun, 26 Mar 2023 03:15:09 +0000 Subject: [PATCH] Add 'restart-hushd.sh' --- restart-hushd.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 restart-hushd.sh diff --git a/restart-hushd.sh b/restart-hushd.sh new file mode 100644 index 0000000..54910da --- /dev/null +++ b/restart-hushd.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Stops and restarts hushd to avoid stupid bugs + +# if hushd is not running, start it +#set -e + +DIR="$HOME/git/hush3/src" +CLI="$DIR/hush-cli" +HUSHD="$DIR/hushd" + +echo "Stopping hushd if it is running..." +$CLI stop + +# TODO: look for lockfile +# testing +#sleep 5 + +# prod +sleep 30 + +# save some logs for now to debug +cp $DIR/hush.log $DIR/hush.log.prev-$$ + +# restart hushd +cd $DIR +$HUSHD &> hush.log & \ No newline at end of file