Thing is: I assume that if wireguard is running, it is connected (as itโs not really possible to query the actual connection state to my knowledge).
Desired behaviour: wiresock process exits if config file is bad/does not exist.
Even so, running service != active tunnel. For example, the configuration file may be present and correct, but Wireguard server may be down or unreachable.
I already have several requests to add a simple application with a tray icon to indicate the status of a WireSock tunnel. So, I need to add some IPC for communication between service and tray app. Probably the simplest would be to create a shared memory section to represent the current state of the service/tunnel, or a simple named pipe request-response mechanism.
More complex, but at the same time more modern and flexible, would be to add a simple web socket server using a third-party library such as websocketpp.
I will give it a think until the next weekend. Any suggestions are appreciated.