4 # homepage: https://git.rootprojects.org/root/serviceman
6 # Serviceman: cross-platform service management for Linux, Mac, and Windows.
8 # Serviceman is a hassle-free wrapper around your system launcher. It works with `launchctl` (macOS), `systemctl` (Linux), and the Windows Registry to make it easy to start _user_ and _system_ level services, such as webservers, backup scripts, network and system tools, etc.
11 # Works with anything, including
16 # serviceman add --name my-service node ./serve.js --port 3000
22 # go build -mod vendor cmd/my-service
23 # serviceman add ./my-service --port 3000
29 # serviceman add --name backuper bash ./backup.sh /mnt/data
37 my_serviceman=$(command -v serviceman)
39 if [ -n "$my_serviceman" ]; then
40 if [ "$my_serviceman" != "$HOME/.local/bin/serviceman" ]; then
41 echo "a serviceman installation (which make take precedence) exists at:"
42 echo " $my_serviceman"
48 webi_download "https://rootprojects.org/serviceman/dist/$(uname -s)/$(uname -m)/serviceman" "$HOME/Downloads/serviceman"
49 chmod +x "$HOME/Downloads/serviceman"
50 mv "$HOME/Downloads/serviceman" "$HOME/.local/bin/"
52 # add to ~/.local/bin to PATH, just in case
53 webi_path_add $HOME/.local/bin # > /dev/null 2> /dev/null
54 # TODO inform user to add to path, apart from pathman?