Exec binding or execute command line that makes an ssh to the Karaf console and execute the restart bundle command. You will want to configure Karaf and the openhab users with SSH certs so you don’t need to supply the password inline in plain text.
If myopenhab is down and that is your only remote access then you have no remote access. There is no way around that. If you need remote access when myopenhab is down, then you need to implement that remote access yourself or use some other remote access service. Your options, in order of preference include:
- Alternative machine remote access services like Teamviewer, etc.
- OpenVPN, requires opening a well known port in your firewall to the Internet
- SSH tunnel using certificate or certificate+password authentication, never password only authentication, requires opening a port in your firewall to the Internet, but you don’t have to use port 22.
- Reverse proxy and a port forward in your firewall to expose your OH directly to the Internet. The reverse proxy implements authentication and encryption.
Personally I use OpenVPN on all of my devices and have SSH as a fallback should the VPN fail for some reason. I even wrote a tutorial for how to Remote Access Using SSH Tunnel on Android. But usually the access I need is to a command prompt so I’ve never actually had to use this since I wrote that tutorial.