Merge pull request #431 from rogerpueyo/p4u/luci-app-bmx7/refactory
Fix bmx7-info indentation and "$info" call
This commit is contained in:
commit
3264d15492
1 changed files with 13 additions and 16 deletions
|
@ -34,7 +34,6 @@ else
|
|||
QUERY="${QUERY_STRING%%=*}"
|
||||
echo "Content-type: application/json"
|
||||
echo ""
|
||||
|
||||
fi
|
||||
|
||||
check_path() {
|
||||
|
@ -83,7 +82,7 @@ print_query() {
|
|||
}
|
||||
|
||||
# If the query is a file, just printing the file
|
||||
[ -f "$BMX7_DIR/$1" ] && cat "$BMX7_DIR/$1";
|
||||
[ -f "$BMX7_DIR/$1" ] && [ -s "$BMX7_DIR/$1" ] && cat "$BMX7_DIR/$1" && return 0 || return 1
|
||||
}
|
||||
|
||||
if [ "${QUERY##*/}" == "all" ]; then
|
||||
|
@ -95,10 +94,8 @@ if [ "$QUERY" == '$info' ]; then
|
|||
echo '{ "info": [ '
|
||||
print_query status
|
||||
echo -n ","
|
||||
print_query interfaces
|
||||
echo -n ","
|
||||
print_query links
|
||||
echo -n ","
|
||||
print_query interfaces && echo -n "," || echo -n '{ "interfaces": "" },'
|
||||
print_query links && echo -n "," || echo -n '{ "links": "" },'
|
||||
print_mem
|
||||
echo "] }"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue