summaryrefslogtreecommitdiffstats
path: root/net/databag/files/databag.init
blob: d6e6e0f145689000b2cbe0942a0639c9da45e2b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh /etc/rc.common
 
USE_PROCD=1
START=50
STOP=51

start_service() {
	# load config
	config_load databag
	config_get store_path "config" "store_path" "/tmp/databag/store"
	config_get service_port "config" "service_port" "7001"

	# init store
	mkdir -p "${store_path}"
	cp -n "/usr/share/databag/databag.db" "${store_path}"

	# setup serice
	procd_open_instance 
	procd_set_param command "/usr/bin/databag"
	procd_append_param command -p "${service_port}"
	procd_append_param command -s "${store_path}"
	procd_append_param command -w "/usr/share/databag/web/build"
	procd_close_instance
}