Lines 17-23
Link Here
|
17 |
# Default: %%IPFS_USER%% |
17 |
# Default: %%IPFS_USER%% |
18 |
# ipfs_go_group (str): ipfs_go daemon group |
18 |
# ipfs_go_group (str): ipfs_go daemon group |
19 |
# Default: %%IPFS_GROUP%% |
19 |
# Default: %%IPFS_GROUP%% |
|
|
20 |
# ipfs_go_path (str): ipfs_go ipfs repo path |
21 |
# Default: %%IPFS_HOME%% |
20 |
|
22 |
|
|
|
23 |
|
21 |
. /etc/rc.subr |
24 |
. /etc/rc.subr |
22 |
|
25 |
|
23 |
name=ipfs_go |
26 |
name=ipfs_go |
Lines 27-32
Link Here
|
27 |
: ${ipfs_go_enable:="NO"} |
30 |
: ${ipfs_go_enable:="NO"} |
28 |
: ${ipfs_go_user:="%%IPFS_USER%%"} |
31 |
: ${ipfs_go_user:="%%IPFS_USER%%"} |
29 |
: ${ipfs_go_group:="%%IPFS_GROUP%%"} |
32 |
: ${ipfs_go_group:="%%IPFS_GROUP%%"} |
|
|
33 |
: ${ipfs_go_path:="%%IPFS_HOME%%"} |
30 |
|
34 |
|
31 |
logfile="%%IPFS_LOGDIR%%/${name}.log" |
35 |
logfile="%%IPFS_LOGDIR%%/${name}.log" |
32 |
pidfile="/var/run/${name}.pid" |
36 |
pidfile="/var/run/${name}.pid" |
Lines 36-42
Link Here
|
36 |
|
40 |
|
37 |
ipfs_go_prestart() { |
41 |
ipfs_go_prestart() { |
38 |
install -d -o ${ipfs_go_user} -g ${ipfs_go_group} -m750 %%IPFS_LOGDIR%% |
42 |
install -d -o ${ipfs_go_user} -g ${ipfs_go_group} -m750 %%IPFS_LOGDIR%% |
39 |
[ -d ~%%IPFS_USER%%/.ipfs ] || /usr/bin/su - ${ipfs_go_user} -c "${command} init" |
43 |
[ -d ${ipfs_go_path} ] || /usr/bin/su - ${ipfs_go_user} -c "env IPFS_PATH=${ipfs_go_path}; ${command} init" |
40 |
} |
44 |
} |
41 |
|
45 |
|
42 |
ipfs_go_start() { |
46 |
ipfs_go_start() { |
Lines 43-48
Link Here
|
43 |
echo running ${command} daemon |
47 |
echo running ${command} daemon |
44 |
export USER=${ipfs_go_user} |
48 |
export USER=${ipfs_go_user} |
45 |
export HOME=$(echo ~%%IPFS_USER%%) |
49 |
export HOME=$(echo ~%%IPFS_USER%%) |
|
|
50 |
export IPFS_PATH=${ipfs_go_path} |
46 |
/usr/sbin/daemon -p ${pidfile} -u ${ipfs_go_user} ${command} daemon >> ${logfile} 2>&1 |
51 |
/usr/sbin/daemon -p ${pidfile} -u ${ipfs_go_user} ${command} daemon >> ${logfile} 2>&1 |
47 |
} |
52 |
} |
48 |
|
53 |
|