databag/net/host/openwrt/files/databag.init
2024-01-12 13:34:32 -08:00

23 lines
406 B
Bash

#!/bin/sh /etc/rc.common
START=10
STOP=15
config_databag() {
config_get store_path "$1" store_path "/tmp/store"
config_get service_port "$1" service_port "7001"
mkdir -p "${store_path}/assets"
cp -n /opt/databag/databag.db ${store_path}
/usr/bin/databag ${service_port} ${store_path}
}
start() {
config_load databag
config_foreach config_databag databag
}
stop() {
killall databag
}