@@ -3,6 +3,9 @@
# the system init finished. By default this file does nothing.
/usr/sbin/configurenetwork
+if [ -s /usr/sbin/configurefffinit ] ; then
+ /usr/sbin/configurefffinit && mv /usr/sbin/configurefffinit /usr/sbin/configurefff
+fi
touch /tmp/started
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-nodewatcher
-PKG_VERSION:=41
+PKG_VERSION:=42
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/fff-nodewatcher
@@ -2,7 +2,7 @@
# Netmon Nodewatcher (C) 2010-2012 Freifunk Oldenburg
# License; GPL v3
-SCRIPT_VERSION="41"
+SCRIPT_VERSION="42"
test -f /tmp/started || exit
@@ -56,20 +56,20 @@ crawl() {
#Get system data from other locations
err "$(date): Collecting basic system status data"
hostname="$(cat /proc/sys/kernel/hostname)"
- description="$(uci get system.@system[0].description)"
+ description="$(uci get fff.@system[0].description)"
if [ -n "$description" ]; then
description="<description><![CDATA[$description]]></description>"
fi
- latitude="$(uci get system.@system[0].latitude)"
- longitude="$(uci get system.@system[0].longitude)"
+ latitude="$(uci get fff.@system[0].latitude)"
+ longitude="$(uci get fff.@system[0].longitude)"
if [ -n "$longitude" -a -n "$latitude" ]; then
geo="<geo><lat>$latitude</lat><lng>$longitude</lng></geo>";
fi
- position_comment="$(uci get system.@system[0].position_comment)"
+ position_comment="$(uci get fff.@system[0].position_comment)"
if [ -n "$position_comment" ]; then
position_comment="<position_comment><![CDATA[$position_comment]]></position_comment>"
fi
- contact="$(uci get system.@system[0].contact)"
+ contact="$(uci get fff.@system[0].contact)"
if [ -n "$contact" ]; then
contact="<contact>$contact</contact>"
fi
@@ -135,9 +135,9 @@ crawl() {
SYSTEM_DATA=$SYSTEM_DATA"${geo}"
SYSTEM_DATA=$SYSTEM_DATA"${position_comment}"
SYSTEM_DATA=$SYSTEM_DATA"${contact}"
- if [ "$(uci -q get "system.@system[0].hood")" ]
+ if [ "$(uci -q get "fff.@system[0].hood")" ]
then
- SYSTEM_DATA=$SYSTEM_DATA"<hood>$(uci -q get "system.@system[0].hood")</hood>"
+ SYSTEM_DATA=$SYSTEM_DATA"<hood>$(uci -q get "fff.@system[0].hood")</hood>"
fi
SYSTEM_DATA=$SYSTEM_DATA"<distname>$distname</distname>"
SYSTEM_DATA=$SYSTEM_DATA"<distversion>$distversion</distversion>"
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-sysupgrade
-PKG_VERSION:=0.0.4
+PKG_VERSION:=5
PKG_RELEASE:=4
PKG_BUILD_DIR:=$(BUILD_DIR)/fff-sysupgrade
@@ -1,21 +1,28 @@
#!/bin/sh
-UPGRADE_hostname=$(uci -q get "system.@system[0].hostname")
-UPGRADE_description=$(uci -q get "system.@system[0].description")
-UPGRADE_latitude=$(uci -q get "system.@system[0].latitude")
-UPGRADE_longitude=$(uci -q get "system.@system[0].longitude")
-UPGRADE_position_comment=$(uci -q get "system.@system[0].position_comment")
-UPGRADE_contact=$(uci -q get "system.@system[0].contact")
+if [ ! -s /etc/config/fff ] ; then
-/bin/rm -rf /etc/config/system
+ UPGRADE_hostname=$(uci -q get "system.@system[0].hostname")
+ UPGRADE_description=$(uci -q get "system.@system[0].description")
+ UPGRADE_latitude=$(uci -q get "system.@system[0].latitude")
+ UPGRADE_longitude=$(uci -q get "system.@system[0].longitude")
+ UPGRADE_position_comment=$(uci -q get "system.@system[0].position_comment")
+ UPGRADE_contact=$(uci -q get "system.@system[0].contact")
-/bin/config_generate
+ /bin/rm -rf /etc/config/system
+
+ /bin/config_generate
-test -n "${UPGRADE_hostname}" && uci -q set "system.@system[0].hostname=${UPGRADE_hostname}"
-test -n "${UPGRADE_description}" && uci -q set "system.@system[0].description=${UPGRADE_description}"
-test -n "${UPGRADE_latitude}" && uci -q set "system.@system[0].latitude=${UPGRADE_latitude}"
-test -n "${UPGRADE_longitude}" && uci -q set "system.@system[0].longitude=${UPGRADE_longitude}"
-test -n "${UPGRADE_position_comment}" && uci -q set "system.@system[0].position_comment=${UPGRADE_position_comment}"
-test -n "${UPGRADE_contact}" && uci -q set "system.@system[0].contact=${UPGRADE_contact}"
+ touch /etc/config/fff
-uci -q commit system
+ uci -q add fff system > /dev/null
+
+ test -n "${UPGRADE_hostname}" && uci -q set "fff.@system[0].hostname=${UPGRADE_hostname}"
+ test -n "${UPGRADE_description}" && uci -q set "fff.@system[0].description=${UPGRADE_description}"
+ test -n "${UPGRADE_latitude}" && uci -q set "fff.@system[0].latitude=${UPGRADE_latitude}"
+ test -n "${UPGRADE_longitude}" && uci -q set "fff.@system[0].longitude=${UPGRADE_longitude}"
+ test -n "${UPGRADE_position_comment}" && uci -q set "fff.@system[0].position_comment=${UPGRADE_position_comment}"
+ test -n "${UPGRADE_contact}" && uci -q set "fff.@system[0].contact=${UPGRADE_contact}"
+
+ uci -q commit fff
+fi
@@ -8,5 +8,5 @@ cat > /etc/sysupgrade.conf <<-__EOF__
/etc/dropbear/dropbear_rsa_host_key
/etc/dropbear/authorized_keys
/etc/network.mode
-/etc/config/system
+/etc/config/fff
__EOF__
new file mode 100755
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+touch /etc/config/fff
+
+if ! uci -q get fff.@system[0] > /dev/null ; then
+ uci -q add fff system > /dev/null
+ uci -q set "fff.@system[0].hostname=Freifunk-Router"
+fi
+
+FFF_hostname=$(uci -q get "fff.@system[0].hostname")
+test -n "${FFF_hostname}" && uci -q set "system.@system[0].hostname=${FFF_hostname}"
+
+traffic_enabled=$(uci -q get "fff.@trafficcontrol[0].enabled")
+traffic_in=$(uci -q get "fff.@trafficcontrol[0].limit_in")
+traffic_out=$(uci -q get "fff.@trafficcontrol[0].limit_out")
+
+test -n "${traffic_enabled}" && uci -q set "simple-tc.example.enabled=${traffic_enabled}"
+uci -q set "simple-tc.example.ifname=$(uci -q get network.wan.ifname)"
+uci -q set "simple-tc.example.limit_ingress=${traffic_in}"
+uci -q set "simple-tc.example.limit_egress=${traffic_out}"
+
+uci -q commit
+
+exit 0
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-vpn-select
-PKG_VERSION:=1
+PKG_VERSION:=2
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/fff-vpn-select
@@ -51,8 +51,8 @@ if ping -w5 -c3 "$test_ipv4_host1" &>/dev/null ||
. /etc/community.cfg
project="$VPN_PROJECT"
mac=$(awk '{ mac=toupper($1); gsub(":", "", mac); print mac }' /sys/class/net/br-mesh/address 2>/dev/null)
- lat=$(uci get system.@system[0].latitude)
- long=$(uci get system.@system[0].longitude)
+ lat=$(uci get fff.@system[0].latitude)
+ long=$(uci get fff.@system[0].longitude)
hostname=$(cat /proc/sys/kernel/hostname)
[ "$hostname" = "OpenWrt" ] && hostname=""
[ "$hostname" = "" ] && hostname="$mac"
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-web
-PKG_VERSION:=0.0.4
+PKG_VERSION:=5
PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/fff-web
@@ -2,12 +2,12 @@
<%
echo -en "Content-Type: text/html\r\n\r\n"
-HOSTNAME=$(uci -q get 'system.@system[0].hostname')
+HOSTNAME=$(uci -q get 'fff.@system[0].hostname')
MAC="$(uci -q get network.mesh.macaddr)"
-lat="$(uci -q get system.@system[0].latitude)"
-lon="$(uci -q get system.@system[0].longitude)"
-contact="$(uci -q get system.@system[0].contact)"
+lat="$(uci -q get fff.@system[0].latitude)"
+lon="$(uci -q get fff.@system[0].longitude)"
+contact="$(uci -q get fff.@system[0].contact)"
. /etc/firmware_release
@@ -47,11 +47,11 @@ contact="$(uci -q get system.@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 -q get 'system.@system[0].description' %></td></tr>
+ <tr><th>Beschreibung:</th><td><% uci -q get 'fff.@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 -q get 'system.@system[0].position_comment' %></td></tr>
+ <tr><th>Standort:</th><td><% uci -q get 'fff.@system[0].position_comment' %></td></tr>
<tr><th>E-Mail Adresse:</th><td><a href="mailto:<%= $contact %>"><%= $contact %></a></td></tr>
</table>
</fieldset>
@@ -12,7 +12,7 @@ nav_entry() {
echo -ne "\t<li${class_active}><a href=\"${script_file}\">$2</a></li>\n\t\t"
}
-HOSTNAME=$(uci -q get 'system.@system[0].hostname')
+HOSTNAME=$(uci -q get 'fff.@system[0].hostname')
NOW=$(date +%s)
#Check if new Firmware check older then 1 day
@@ -13,25 +13,33 @@ if [ "$REQUEST_METHOD" == "POST" ] ; then
MSG='<span class="red">Knotenname enthält ungültige Zeichen!</span>'
else
# Allgemeine Einstellungen
+ uci -q set "fff.@system[0].hostname=${POST_hostname}"
+ echo $(uci -q get "fff.@system[0].hostname") > /proc/sys/kernel/hostname
uci -q set "system.@system[0].hostname=${POST_hostname}"
- uci -q get 'system.@system[0].hostname' > /proc/sys/kernel/hostname
- uci -q set "system.@system[0].description=${POST_description}"
- uci -q set "system.@system[0].latitude=${POST_latitude}"
- uci -q set "system.@system[0].longitude=${POST_longitude}"
- uci -q set "system.@system[0].position_comment=${POST_position_comment}"
- uci -q set "system.@system[0].contact=${POST_contact}"
+ uci -q set "fff.@system[0].description=${POST_description}"
+ uci -q set "fff.@system[0].latitude=${POST_latitude}"
+ uci -q set "fff.@system[0].longitude=${POST_longitude}"
+ uci -q set "fff.@system[0].position_comment=${POST_position_comment}"
+ uci -q set "fff.@system[0].contact=${POST_contact}"
# Bitratenbegrenzung
+ uci -q get "fff.@trafficcontrol[0]" > /dev/null || uci -q add fff trafficcontrol > /dev/null
if [ "$POST_traffic_limit" == "on" ] ; then
- uci -q set "simple-tc.example.ifname=$(uci -q get network.wan.ifname)"
+ uci -q set "fff.@trafficcontrol[0].enabled=1"
uci -q set "simple-tc.example.enabled=1"
else
+ uci -q set "fff.@trafficcontrol[0].enabled=0"
uci -q set "simple-tc.example.enabled=0"
fi
+ uci -q set "fff.@trafficcontrol[0].limit_in=${POST_limit_ingress}"
+ uci -q set "fff.@trafficcontrol[0].limit_out=${POST_limit_egress}"
+
+ uci -q set "simple-tc.example.ifname=$(uci -q get network.wan.ifname)"
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>'
fi
fi
@@ -40,7 +48,7 @@ fi
<%in /www/ssl/cgi-bin/helpers %>
<%
# read
-if [ "$(uci -q get 'simple-tc.example.enabled')" == "1" ] ; then
+if [ "$(uci -q get 'fff.@trafficcontrol[0].enabled')" == "1" ] ; then
traffic_checked="checked"
else
traffic_checked=""
@@ -54,16 +62,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 -q get 'system.@system[0].description') %>" /></td></tr>
+ <tr><th>Knotenbeschreibung:</th><td><input type="text" name="description" value="<%= $(uci -q get 'fff.@system[0].description') %>" /></td></tr>
<tr><th>GPS Breitengrad:</th>
- <td><input type="text" name="latitude" value="<%= $(uci -q get 'system.@system[0].latitude') %>" /></td>
+ <td><input type="text" name="latitude" value="<%= $(uci -q get 'fff.@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 -q get 'system.@system[0].longitude') %>" /></td></tr>
- <tr><th>Standortbeschreibung:</th><td><input type="text" name="position_comment" value="<%= $(uci -q get 'system.@system[0].position_comment') %>" /></td></tr>
- <tr><th>E-Mail Adresse:</th><td><input type="email" name="contact" value="<%= $(uci -q get 'system.@system[0].contact') %>" /></td></tr>
+ <tr><th>GPS Längengrad:</th><td><input type="text" name="longitude" value="<%= $(uci -q get 'fff.@system[0].longitude') %>" /></td></tr>
+ <tr><th>Standortbeschreibung:</th><td><input type="text" name="position_comment" value="<%= $(uci -q get 'fff.@system[0].position_comment') %>" /></td></tr>
+ <tr><th>E-Mail Adresse:</th><td><input type="email" name="contact" value="<%= $(uci -q get 'fff.@system[0].contact') %>" /></td></tr>
</table>
</fieldset>
</td><td>
@@ -73,8 +81,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 -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>
+ <tr><th>Freifunk Download:</th><td><input type="text" name="limit_ingress" value="<%= $(uci -q get 'fff.@trafficcontrol[0].limit_in') %>" /></td><td>kbit/s</td></tr>
+ <tr><th>Freifunk Upload:</th><td><input type="text" name="limit_egress" value="<%= $(uci -q get 'fff.@trafficcontrol[0].limit_out') %>" /></td><td>kbit/s</td></tr>
</table>
</fieldset>
</td></tr>