summaryrefslogtreecommitdiff
path: root/rerun.sh
blob: 7f28b5cf12f00e34c9c3b277c6b21dddb36b705f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash
{
	socat -L'lock' 'UNIX-LISTEN:./s2s,fork' 'OPENSSL:irc.andrewyu.org:7005' &
	while ! [ -S ./s2s ]; do
		sleep 0.1
	done
	start=`date -u +%s`
	./haxserv
	uptime=$((`date -u +%s` - $start))
	if (($uptime < 10)); then
		sleep $((10 - $uptime))
	fi

	exec "$0" "$@"
}