20 lines
428 B
Bash
Executable File
20 lines
428 B
Bash
Executable File
#!/bin/sh
|
|
port_up() {
|
|
ss -ltn | grep -qE '127\.0\.0\.1:64[67][0-9]'
|
|
}
|
|
|
|
while true; do
|
|
while ! port_up; do sleep 2; done
|
|
sleep 5
|
|
port_up || continue # port vanished again, Discord was still restarting
|
|
|
|
discover-overlay >> /tmp/discover-overlay.log 2>&1 &
|
|
pid=$!
|
|
|
|
while port_up && kill -0 "$pid" 2>/dev/null; do sleep 3; done
|
|
|
|
kill "$pid" 2>/dev/null
|
|
wait "$pid" 2>/dev/null
|
|
sleep 2
|
|
done
|