mirror of
https://git.openwrt.org/feed/packages.git
synced 2024-06-16 04:14:01 +02:00
36 lines
708 B
Plaintext
36 lines
708 B
Plaintext
![]() |
#!/bin/sh /etc/rc.common
|
||
|
|
||
|
START=95
|
||
|
STOP=05
|
||
|
|
||
|
USE_PROCD=1
|
||
|
PROG=/usr/sbin/clixon_backend
|
||
|
CONFIGFILE=/etc/clixon/clixon.xml
|
||
|
|
||
|
get_xmldb_dir() {
|
||
|
$PROG -F -f "$CONFIGFILE" -1 -l s -C text -s none \
|
||
|
| awk '/^ CLICON_XMLDB_DIR / { print substr($2, 0, length($2) - 1); }'
|
||
|
}
|
||
|
|
||
|
start_service() {
|
||
|
local state="init"
|
||
|
|
||
|
[ -f "$(get_xmldb_dir)/running_db" ] && state="running"
|
||
|
|
||
|
procd_open_instance
|
||
|
procd_set_param command "$PROG"
|
||
|
|
||
|
procd_set_param file $CONFIGFILE
|
||
|
|
||
|
procd_append_param command -F
|
||
|
procd_append_param command -f $CONFIGFILE
|
||
|
procd_append_param command -l s
|
||
|
procd_append_param command -s $state
|
||
|
|
||
|
procd_close_instance
|
||
|
}
|
||
|
|
||
|
stop_service() {
|
||
|
service_stop "$PROG"
|
||
|
}
|