Files
packages/utils/clixon/files/clixon.init
Philip Prindeville 7c3bf478f7 clixon: Initial packaging
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>
2023-12-05 10:59:08 -07:00

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"
}