Skip to content

Instantly share code, notes, and snippets.

@atl
Last active December 19, 2017 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atl/d4836630918e80e9dd3953c9d2dc3bbb to your computer and use it in GitHub Desktop.
Save atl/d4836630918e80e9dd3953c9d2dc3bbb to your computer and use it in GitHub Desktop.
ubooquity rc.d
#!/bin/sh
# PROVIDE: ubooquity
# REQUIRE: NETWORKING
# BEFORE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable this service:
#
# ubooquity_enable (bool): Set it to YES to enable mdnsd(8) on startup.
# Default: NO
. /etc/rc.subr
name=ubooquity
desc="Book and Comic service"
rcvar=ubooquity_enable
: ${ubooquity_enable:=NO}
: ${ubooquity_libraryport:=80}
ubooquity_chdir=/ubooquity
java_cmd=/usr/local/openjdk8-jre/bin/java
java_flags="-Xmx1024m"
java_jar="Ubooquity.jar"
ubooquity_flags="${java_flags} -jar ${java_jar} --headless --remoteadmin --libraryport ${ubooquity_libraryport}"
command_args="</dev/null &>/dev/null"
command="${java_cmd}"
load_rc_config $name
run_rc_command "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment