[Code formatting: Change indentation style to space](https://github.com/clicon/clixon/issues/379)
* Applies to all c/h/y/l/sh files and .editorconfig
This commit is contained in:
parent
a9d1ab006c
commit
d84c529ff1
376 changed files with 38147 additions and 38133 deletions
|
|
@ -91,7 +91,7 @@ EOF
|
|||
function rpcstatus()
|
||||
{
|
||||
if [ $# -ne 2 ]; then
|
||||
err1 "rpcstatus: # arguments: 2" "$#"
|
||||
err1 "rpcstatus: # arguments: 2" "$#"
|
||||
fi
|
||||
active=$1
|
||||
status=$2
|
||||
|
|
@ -107,23 +107,23 @@ EOF
|
|||
expect="<pid $LIBNS>[0-9]*</pid>"
|
||||
match=$(echo "$retx" | grep --null -Go "$expect")
|
||||
if [ -z "$match" ]; then
|
||||
pid=0
|
||||
pid=0
|
||||
else
|
||||
pid=$(echo "$match" | awk -F'[<>]' '{print $3}')
|
||||
pid=$(echo "$match" | awk -F'[<>]' '{print $3}')
|
||||
fi
|
||||
if [ -z "$pid" ]; then
|
||||
err "No pid return value" "$retx"
|
||||
err "No pid return value" "$retx"
|
||||
fi
|
||||
if $active; then
|
||||
expect="^<rpc-reply $DEFAULTNS><active $LIBNS>$active</active><description $LIBNS>Clixon RESTCONF process</description><command $LIBNS>/.*/clixon_restconf -f $cfg -D [0-9] .*</command><status $LIBNS>$status</status><starttime $LIBNS>20[0-9][0-9]\-[0-9][0-9]\-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9]*Z</starttime><pid $LIBNS>$pid</pid></rpc-reply>$"
|
||||
expect="^<rpc-reply $DEFAULTNS><active $LIBNS>$active</active><description $LIBNS>Clixon RESTCONF process</description><command $LIBNS>/.*/clixon_restconf -f $cfg -D [0-9] .*</command><status $LIBNS>$status</status><starttime $LIBNS>20[0-9][0-9]\-[0-9][0-9]\-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9]*Z</starttime><pid $LIBNS>$pid</pid></rpc-reply>$"
|
||||
else
|
||||
# inactive, no startime or pid
|
||||
expect="^<rpc-reply $DEFAULTNS><active $LIBNS>$active</active><description $LIBNS>Clixon RESTCONF process</description><command $LIBNS>/.*/clixon_restconf -f $cfg -D [0-9] .*</command><status $LIBNS>$status</status></rpc-reply>$"
|
||||
# inactive, no startime or pid
|
||||
expect="^<rpc-reply $DEFAULTNS><active $LIBNS>$active</active><description $LIBNS>Clixon RESTCONF process</description><command $LIBNS>/.*/clixon_restconf -f $cfg -D [0-9] .*</command><status $LIBNS>$status</status></rpc-reply>$"
|
||||
fi
|
||||
|
||||
match=$(echo "$retx" | grep --null -Go "$expect")
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$retx"
|
||||
err "$expect" "$retx"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -159,9 +159,9 @@ cat<<EOF > $startupdb
|
|||
<log-destination>$LOGDST</log-destination>
|
||||
<socket>
|
||||
<namespace>default</namespace>
|
||||
<address>0.0.0.0</address>
|
||||
<port>80</port>
|
||||
<ssl>false</ssl>
|
||||
<address>0.0.0.0</address>
|
||||
<port>80</port>
|
||||
<ssl>false</ssl>
|
||||
</socket>
|
||||
</restconf>
|
||||
</${DATASTORE_TOP}>
|
||||
|
|
@ -175,7 +175,7 @@ if [ $BE -ne 0 ]; then
|
|||
new "kill old backend"
|
||||
sudo clixon_backend -z -f $cfg
|
||||
if [ $? -ne 0 ]; then
|
||||
err
|
||||
err
|
||||
fi
|
||||
|
||||
new "start backend -s startup -f $cfg"
|
||||
|
|
@ -316,7 +316,7 @@ if [ $BE -ne 0 ]; then
|
|||
# Check if premature kill
|
||||
pid=$(pgrep -u root -f clixon_backend)
|
||||
if [ -z "$pid" ]; then
|
||||
err "backend already dead"
|
||||
err "backend already dead"
|
||||
fi
|
||||
# kill backend
|
||||
stop_backend -f $cfg
|
||||
|
|
@ -331,7 +331,7 @@ if [ $BE -ne 0 ]; then
|
|||
new "kill old backend"
|
||||
sudo clixon_backend -z -f $cfg
|
||||
if [ $? -ne 0 ]; then
|
||||
err
|
||||
err
|
||||
fi
|
||||
new "start backend -s none -f $cfg"
|
||||
start_backend -s none -f $cfg
|
||||
|
|
@ -354,7 +354,7 @@ if [ $BE -ne 0 ]; then
|
|||
# Check if premature kill
|
||||
pid=$(pgrep -u root -f clixon_backend)
|
||||
if [ -z "$pid" ]; then
|
||||
err "backend already dead"
|
||||
err "backend already dead"
|
||||
fi
|
||||
# kill backend
|
||||
stop_backend -f $cfg
|
||||
|
|
@ -375,9 +375,9 @@ cat<<EOF > $startupdb
|
|||
<log-destination>$LOGDST</log-destination>
|
||||
<socket>
|
||||
<namespace>default</namespace>
|
||||
<address>0.0.0.0</address>
|
||||
<port>80</port>
|
||||
<ssl>false</ssl>
|
||||
<address>0.0.0.0</address>
|
||||
<port>80</port>
|
||||
<ssl>false</ssl>
|
||||
</socket>
|
||||
</restconf>
|
||||
</${DATASTORE_TOP}>
|
||||
|
|
@ -392,7 +392,7 @@ if [ $BE -ne 0 ]; then
|
|||
new "kill old backend"
|
||||
sudo clixon_backend -z -f $cfg
|
||||
if [ $? -ne 0 ]; then
|
||||
err
|
||||
err
|
||||
fi
|
||||
new "start backend -s startup -f $cfg"
|
||||
start_backend -s startup -f $cfg
|
||||
|
|
@ -483,7 +483,7 @@ if [ $BE -ne 0 ]; then
|
|||
# Check if premature kill
|
||||
pid=$(pgrep -u root -f clixon_backend)
|
||||
if [ -z "$pid" ]; then
|
||||
err "backend already dead"
|
||||
err "backend already dead"
|
||||
fi
|
||||
# kill backend
|
||||
stop_backend -f $cfg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue