mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 19:14:30 +04:00
Clixon is a YANG-based configuration manager, with interactive CLI, NETCONF and RESTCONF interfaces, an embedded database and transaction mechanism. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
36 lines
708 B
Bash
Executable File
36 lines
708 B
Bash
Executable File
#!/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"
|
|
}
|