diff --git a/tools/amane-remote.sh b/tools/amane-remote.sh index 459dc20..836adc7 100755 --- a/tools/amane-remote.sh +++ b/tools/amane-remote.sh @@ -55,6 +55,9 @@ start) # the old shell can take a few seconds to let go of amane's socket; wait for it, or the new one panics remote 'test -f shell.pid && kill $(cat shell.pid) 2>/dev/null for i in $(seq 50); do pgrep -F shell.pid > /dev/null 2>&1 || break; sleep 0.1; done + # a shell this script did not start belongs to the user: leave it, and say so + other=$(pgrep -x amane-shell) + if [ -n "$other" ]; then echo "not started: another amane-shell runs (pid $other), not started by this script"; exit 1; fi binary=~/.cache/amane/amane-shell test -x "$binary" || binary=~/.cache/amane/project/target/debug/amane-shell AMANE_FRAMES=1 setsid -f sh -c "echo \$\$ > shell.pid; exec $binary" > shell.log 2>&1