diff --git a/rowbot b/rowbot index 8708ab8..050e1d9 100755 --- a/rowbot +++ b/rowbot @@ -297,7 +297,7 @@ on_sys_first_002_net() { socat "$conn_args" - <"$sock_dir"/rowbot-in.sock >"$sock_dir"/rowbot-out.sock & tls_pid=$! - exec {out_sock}>"$sock_dir"/rowbot-out.sock {in_sock}<"$sock_dir"/rowbot-in.sock + exec {out_sock}>"$sock_dir"/rowbot-in.sock {in_sock}<"$sock_dir"/rowbot-out.sock log_debug "process %d is handling tls" "$tls_pid" fi } @@ -308,6 +308,11 @@ on_sys_exit_998_net() { exec {irc_sock}>&- else log_info "rowbot is closing the connection to ircs://%s:%s" "${config[server]}" "${config[port]}" + + if [[ -v tls_pid ]]; then + kill -INT "$tls_pid" + fi + rm -rf -- "$sock_dir" fi }