[PATCH v4 01/15] fff-web: fix uci command line syntax
Tim Niemeyer
tim at tn-x.org
Fr Feb 17 08:06:51 CET 2017
Signed-off-by: Tim Niemeyer <tim at tn-x.org>
Reviewed-by: Christian Dresel <fff at chrisi01.de>
---
Changes in v4: None
Changes in v3: None
Changes in v2:
- New Patch
.../fff-web/files/www/public/cgi-bin/status.html | 12 +++----
.../fff/fff-web/files/www/ssl/cgi-bin/header | 2 +-
.../fff-web/files/www/ssl/cgi-bin/settings.html | 40 +++++++++++-----------
3 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/src/packages/fff/fff-web/files/www/public/cgi-bin/status.html b/src/packages/fff/fff-web/files/www/public/cgi-bin/status.html
index afd3b89..968d816 100755
--- a/src/packages/fff/fff-web/files/www/public/cgi-bin/status.html
+++ b/src/packages/fff/fff-web/files/www/public/cgi-bin/status.html
@@ -2,12 +2,12 @@
<%
echo -en "Content-Type: text/html\r\n\r\n"
-HOSTNAME=$(uci get -q 'system. at system[0].hostname')
+HOSTNAME=$(uci -q get 'system. at system[0].hostname')
MAC="$(uci -q get network.mesh.macaddr)"
-lat="$(uci get -q system. at system[0].latitude)"
-lon="$(uci get -q system. at system[0].longitude)"
-contact="$(uci get -q system. at system[0].contact)"
+lat="$(uci -q get system. at system[0].latitude)"
+lon="$(uci -q get system. at system[0].longitude)"
+contact="$(uci -q get system. at system[0].contact)"
. /etc/firmware_release
@@ -47,11 +47,11 @@ contact="$(uci get -q system. at system[0].contact)"
<tr><th>MAC-Adresse:</th><td style="text-transform: uppercase;"><a href="https://monitoring.freifunk-franken.de/api/get_router_by_mac/<%= $MAC %>"><%= $MAC %></a></td></tr>
<tr><th>Modell:</th><td><% cat /tmp/sysinfo/model 2>/dev/null %></td></tr>
<tr><th>Firmware:</th><td><%= ${FIRMWARE_VERSION} %></td></tr>
- <tr><th>Beschreibung:</th><td><% uci get -q 'system. at system[0].description' %></td></tr>
+ <tr><th>Beschreibung:</th><td><% uci -q get 'system. at system[0].description' %></td></tr>
<tr><th>Position:</th><td><% if [ -n "$lat" -a -n "$lon" ]; then
echo "<a href=\"https://monitoring.freifunk-franken.de/map?mapcenter=$lat,$lon,16\">${lat:0:8}N, ${lon:0:8}E</a>"
fi %></td></tr>
- <tr><th>Standort:</th><td><% uci get -q 'system. at system[0].position_comment' %></td></tr>
+ <tr><th>Standort:</th><td><% uci -q get 'system. at system[0].position_comment' %></td></tr>
<tr><th>E-Mail Adresse:</th><td><a href="mailto:<%= $contact %>"><%= $contact %></a></td></tr>
</table>
</fieldset>
diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header
index 4cecfcd..92bdbc6 100755
--- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header
+++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header
@@ -10,7 +10,7 @@ nav_entry() {
echo -ne "\t<li${class_active}><a href=\"${script_file}\">$2</a></li>\n\t\t"
}
-HOSTNAME=$(uci get -q 'system. at system[0].hostname')
+HOSTNAME=$(uci -q get 'system. at system[0].hostname')
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/settings.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/settings.html
index 859cf94..a7417dc 100755
--- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/settings.html
+++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/settings.html
@@ -13,23 +13,23 @@ if [ "$REQUEST_METHOD" == "POST" ] ; then
MSG='<span class="red">Knotenname enthält ungültige Zeichen!</span>'
else
# Allgemeine Einstellungen
- uci set -q "system. at system[0].hostname=${POST_hostname}"
- uci get -q 'system. at system[0].hostname' > /proc/sys/kernel/hostname
- uci set -q "system. at system[0].description=${POST_description}"
- uci set -q "system. at system[0].latitude=${POST_latitude}"
- uci set -q "system. at system[0].longitude=${POST_longitude}"
- uci set -q "system. at system[0].position_comment=${POST_position_comment}"
- uci set -q "system. at system[0].contact=${POST_contact}"
+ uci -q set "system. at system[0].hostname=${POST_hostname}"
+ uci -q get 'system. at system[0].hostname' > /proc/sys/kernel/hostname
+ uci -q set "system. at system[0].description=${POST_description}"
+ uci -q set "system. at system[0].latitude=${POST_latitude}"
+ uci -q set "system. at system[0].longitude=${POST_longitude}"
+ uci -q set "system. at system[0].position_comment=${POST_position_comment}"
+ uci -q set "system. at system[0].contact=${POST_contact}"
# Bitratenbegrenzung
if [ "$POST_traffic_limit" == "on" ] ; then
- uci set -q "simple-tc.example.ifname=$(uci -q get network.wan.ifname)"
- uci set -q "simple-tc.example.enabled=1"
+ uci -q set "simple-tc.example.ifname=$(uci -q get network.wan.ifname)"
+ uci -q set "simple-tc.example.enabled=1"
else
- uci set -q "simple-tc.example.enabled=0"
+ uci -q set "simple-tc.example.enabled=0"
fi
- uci set -q "simple-tc.example.limit_ingress=${POST_limit_ingress}"
- uci set -q "simple-tc.example.limit_egress=${POST_limit_egress}"
+ uci -q set "simple-tc.example.limit_ingress=${POST_limit_ingress}"
+ uci -q set "simple-tc.example.limit_egress=${POST_limit_egress}"
uci commit
MSG='<span class="green">Daten gespeichert! - Bitte Router neustarten.</span>'
@@ -40,7 +40,7 @@ fi
<%in /www/ssl/cgi-bin/helpers %>
<%
# read
-if [ "$(uci get -q 'simple-tc.example.enabled')" == "1" ] ; then
+if [ "$(uci -q get 'simple-tc.example.enabled')" == "1" ] ; then
traffic_checked="checked"
else
traffic_checked=""
@@ -54,16 +54,16 @@ fi
<legend>Allgemeine Einstellungen</legend>
<table>
<tr><th>Knotenname:</th><td><input type="text" name="hostname" value="<%= ${HOSTNAME} %>" /></td></tr>
- <tr><th>Knotenbeschreibung:</th><td><input type="text" name="description" value="<%= $(uci get -q 'system. at system[0].description') %>" /></td></tr>
+ <tr><th>Knotenbeschreibung:</th><td><input type="text" name="description" value="<%= $(uci -q get 'system. at system[0].description') %>" /></td></tr>
<tr><th>GPS Breitengrad:</th>
- <td><input type="text" name="latitude" value="<%= $(uci get -q 'system. at system[0].latitude') %>" /></td>
+ <td><input type="text" name="latitude" value="<%= $(uci -q get 'system. at system[0].latitude') %>" /></td>
<td rowspan="2" style="vertical-align: middle;">
<button type="button" style="height: 100%; width: 126px; margin-left: 5px;" onclick="window.open('/map.html', '_blank', 'location=0,status=0,scrollbars=1,width=400,height=300');">Position auf Karte anzeigen / setzen</button>
</td>
</tr>
- <tr><th>GPS Längengrad:</th><td><input type="text" name="longitude" value="<%= $(uci get -q 'system. at system[0].longitude') %>" /></td></tr>
- <tr><th>Standortbeschreibung:</th><td><input type="text" name="position_comment" value="<%= $(uci get -q 'system. at system[0].position_comment') %>" /></td></tr>
- <tr><th>E-Mail Adresse:</th><td><input type="email" name="contact" value="<%= $(uci get -q 'system. at system[0].contact') %>" /></td></tr>
+ <tr><th>GPS Längengrad:</th><td><input type="text" name="longitude" value="<%= $(uci -q get 'system. at system[0].longitude') %>" /></td></tr>
+ <tr><th>Standortbeschreibung:</th><td><input type="text" name="position_comment" value="<%= $(uci -q get 'system. at system[0].position_comment') %>" /></td></tr>
+ <tr><th>E-Mail Adresse:</th><td><input type="email" name="contact" value="<%= $(uci -q get 'system. at system[0].contact') %>" /></td></tr>
</table>
</fieldset>
</td><td>
@@ -73,8 +73,8 @@ fi
<tr><th>Aktiviert:</th><td colspan="2">
<input type="checkbox" name="traffic_limit" <%= ${traffic_checked} %>>
</td></tr>
- <tr><th>Freifunk Download:</th><td><input type="text" name="limit_ingress" value="<%= $(uci get -q 'simple-tc.example.limit_ingress') %>" /></td><td>kbit/s</td></tr>
- <tr><th>Freifunk Upload:</th><td><input type="text" name="limit_egress" value="<%= $(uci get -q 'simple-tc.example.limit_egress') %>" /></td><td>kbit/s</td></tr>
+ <tr><th>Freifunk Download:</th><td><input type="text" name="limit_ingress" value="<%= $(uci -q get 'simple-tc.example.limit_ingress') %>" /></td><td>kbit/s</td></tr>
+ <tr><th>Freifunk Upload:</th><td><input type="text" name="limit_egress" value="<%= $(uci -q get 'simple-tc.example.limit_egress') %>" /></td><td>kbit/s</td></tr>
</table>
</fieldset>
</td></tr>
--
2.1.4
Mehr Informationen über die Mailingliste franken-dev