mirror of
https://git.freebsd.org/ports.git
synced 2025-06-13 00:30:33 -04:00
- Fix rc.d script starting at boot - Update default datastore location to match commands default Approved by: Maintainer
38 lines
689 B
Bash
38 lines
689 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: ipfs_go
|
|
# REQUIRE: NETWORKING
|
|
# BEFORE: LOGIN
|
|
# KEYWORD: shutdown
|
|
|
|
# Define these ipfs_go_* variables in /etc/rc.conf[.local]:
|
|
#
|
|
# ipfs_go_enable="YES"
|
|
# ipfs_go_path="/tank/ipfs"
|
|
|
|
. /etc/rc.subr
|
|
|
|
: ${ipfs_go_enable:="NO"}
|
|
: ${ipfs_go_path:="/root/.ipfs"}
|
|
|
|
name=ipfs_go
|
|
rcvar=ipfs_go_enable
|
|
command="%%PREFIX%%/bin/ipfs-go"
|
|
|
|
start_precmd="ipfs_go_prestart"
|
|
start_cmd="ipfs_go_start"
|
|
|
|
ipfs_go_prestart() {
|
|
[ -d ${ipfs_go_path}/datastore ] || env IPFS_PATH=${ipfs_go_path} ${command} init
|
|
}
|
|
|
|
ipfs_go_start() {
|
|
echo running ${command} daemon
|
|
env IPFS_PATH=${ipfs_go_path} daemon -f ${command} daemon
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|