Developing lightweight computation at the DSG edge

Commit 7bc49184 authored by Simó Albert i Beltran's avatar Simó Albert i Beltran
Browse files

sed -i -e 's/\s\+$//g' packages/bmx6-luci/files/www/cgi-bin/bmx6-info

parent 6a1f0e4b
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
BMX6_DIR="$(uci get bmx6.general.runtimeDir 2>/dev/null)" || BMX6_DIR="/var/run/bmx6/json" BMX6_DIR="$(uci get bmx6.general.runtimeDir 2>/dev/null)" || BMX6_DIR="/var/run/bmx6/json"
#Checking if shell mode or cgi-bin mode #Checking if shell mode or cgi-bin mode
if [ "$1" == "-s" ]; then if [ "$1" == "-s" ]; then
QUERY="$2" QUERY="$2"
else else
QUERY="${QUERY_STRING%%=*}" QUERY="${QUERY_STRING%%=*}"
echo "Content-type: application/json" echo "Content-type: application/json"
echo "" echo ""
...@@ -48,7 +48,7 @@ print_query() { ...@@ -48,7 +48,7 @@ print_query() {
{ {
# If /all has not been specified # If /all has not been specified
[ -z "$QALL" ] && [ -z "$QALL" ] &&
{ {
total=$(ls $BMX6_DIR/$1 | wc -w) total=$(ls $BMX6_DIR/$1 | wc -w)
i=1 i=1
echo -n "{ \"$1\": [ " echo -n "{ \"$1\": [ "
...@@ -56,7 +56,7 @@ print_query() { ...@@ -56,7 +56,7 @@ print_query() {
echo -n "{ \"name\": \"$f\" }" echo -n "{ \"name\": \"$f\" }"
[ $i -lt $total ] && echo -n ',' [ $i -lt $total ] && echo -n ','
i=$(( $i + 1 )) i=$(( $i + 1 ))
done done
echo -n " ] }" echo -n " ] }"
# If /all has been specified, printing all the files together # If /all has been specified, printing all the files together
...@@ -64,7 +64,7 @@ print_query() { ...@@ -64,7 +64,7 @@ print_query() {
comma="" comma=""
echo -n "[ " echo -n "[ "
for entry in "$BMX6_DIR/$1/"*; do for entry in "$BMX6_DIR/$1/"*; do
[ -f "$entry" ] && [ -f "$entry" ] &&
{ {
${comma:+echo "$comma"} ${comma:+echo "$comma"}
tr -d '\n' < "$entry" tr -d '\n' < "$entry"
...@@ -72,7 +72,7 @@ print_query() { ...@@ -72,7 +72,7 @@ print_query() {
} }
done done
echo -n " ]" echo -n " ]"
} }
} }
# If the query is a file, just printing the file # If the query is a file, just printing the file
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment