4 # homepage: https://git.rootprojects.org/root/serviceman
5 # tagline: cross-platform service management for Linux, Mac, and Windows
7 # A system laucher that wraps `launchctl` (macOS), `systemctl` (Linux),
8 # and the Windows Registry to work cross-platform.
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
36 my_url="https://rootprojects.org/serviceman/dist/$(uname -s)/$(uname -m)/serviceman"
37 curl -fsSL "$my_url" -o serviceman
41 # Move to ~/.local/bin
43 mv ./serviceman ~/.local/bin
47 my_serviceman=$(command -v serviceman)
49 if [ -n "$my_serviceman" ]; then
50 if [ "$my_serviceman" != "$HOME/.local/bin/serviceman" ]; then
51 echo "a serviceman installation (which make take precedence) exists at:"
52 echo " $my_serviceman"
57 # add to ~/.local/bin to PATH, just in case
58 pathman add ~/.local/bin # > /dev/null 2> /dev/null
59 # TODO inform user to add to path, apart from pathman?