Skip to content

Commit

Permalink
add freebsd rc conf
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Dec 31, 2024
1 parent eaa486f commit cd0cc07
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions dist/grasshopper.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

# PROVIDE: grasshopper
# REQUIRE: NETWORKING
# KEYWORD: shutdown

# FreeBSD startup script, rename and put this file to
# /usr/local/etc/rc.d/grasshopper
# and, run:
# chmod +x /usr/local/etc/rc.d/grasshopper
# echo grasshopper_enable="YES" >> /etc/rc.conf
# service start grasshopper

. /etc/rc.subr

name="grasshopper" # How the service will be invoked from service
desc="grasshopper daemon" # the description
rcvar="grasshopper_enable" # The variable in rc.conf that will allow this service to run
load_rc_config $name # Loads the config file, if relevant.
: ${grasshopper_enable:="NO"}

dir="/home/xtaci" # change this to the directory where grasshopper binaries are.
command="/usr/sbin/daemon"
pidfile="/var/run/${name}.pid"
command_args="-c -f -S -P ${pidfile} -r $dir/grasshopper_freebsd_amd64 start -c $dir/grasshopper.toml"

run_rc_command "$1"

0 comments on commit cd0cc07

Please sign in to comment.