runssh () { ssh -T -oControlPath="./$host.ctrl" "$@"; }
-stopit () {
-
- ## Initial shutdown protocol.
- writefile "$host.state" stopping
- if [ -f "$host.pid" ]; then kill $(cat "$host.pid") 2>/dev/null || :; fi
- rm -f "$host.pid"
+clobber () {
## Shut down an existing connection if there is one.
if [ -S "$host.ctrl" ]; then
## Remove the stale socket.
rm -f "$host.ctrl"
fi
+}
+
+stopit () {
+
+ ## Initial shutdown protocol.
+ writefile "$host.state" stopping
+ if [ -f "$host.pid" ]; then kill $(cat "$host.pid") 2>/dev/null || :; fi
+ rm -f "$host.pid"
+
+ ## Clobber the existing connection, if there is one.
+ clobber
## Update the state.
rm -f "$host.state" "$host.pid"