These have only been tested on openhabian, but should work on most linux as long as openhab is in the standard path. Future changes could include use of environment variables if necessary.
To install follow the readme, but basically clone my repository and run the oh install script.
Did you know that openHAB’s apt (and therefore openHABian) and RPM packages come with commands already? They should be on your server too:
openhab-cli --help
Usage: openhab-cli command [options]
Possible commands:
backup [filename] -- Stores the current configuration of openHAB.
clean-cache -- Cleans the openHAB temporary folders.
console -- Opens the openHAB console.
info -- Displays distribution information.
reset-ownership -- Gives openHAB control of its own directories.
restore filename -- Restores the openHAB configuration from a backup.
showlogs -- Displays the log messages of openHAB.
start [--debug] -- Starts openHAB in the terminal.
status -- Checks to see if openHAB is running.
stop -- Stops any running instance of openHAB.
That said, the start and restart commands in these scripts do not use the service file, only start a manual instance while hinting that systemctl should be used.