There was a thing called "REMOTE-SHUTDOWN-LISTENER" which would wait for a
connect to a particular TCP port and then run OPC$CRASH when that happened. It was
intended for use with simh to allow the guest VMS OS to be shut down automatically when
the host OS shuts down. Not exactly what is wanted, but it shouldn't be too hard to
adapt to listen to a serial port instead.
Don't remember who wrote it, but the C source is included. I put a copy in
LEGATO::REMOTE-SHUTDOWN-LISTENER.ZIP.
Bob