From 9fb41d9190d3ce06574fd26aef2fcf387beb0dd3 Mon Sep 17 00:00:00 2001 From: Tim Niemeyer Date: Sun, 17 Aug 2014 13:37:46 +0200 Subject: [PATCH] clean up old and unused files Signed-off-by: Tim Niemeyer --- bsp/default/root_file_system/etc/admin.sh | 221 ------- bsp/default/root_file_system/etc/cache.sh | 38 -- bsp/default/root_file_system/etc/clients.sh | 16 - .../root_file_system/etc/clients_event.sh | 18 - .../root_file_system/etc/crontabs/root | 2 +- bsp/default/root_file_system/etc/downup.sh | 19 - bsp/default/root_file_system/etc/init.d/zapp | 622 ------------------ bsp/default/root_file_system/etc/rc.local.tpl | 3 - bsp/default/root_file_system/etc/report.sh | 247 ------- bsp/default/root_file_system/etc/serve.sh | 13 - .../root_file_system/etc/statistics.sh | 50 -- .../root_file_system/etc/variable_splash.sh | 32 - bsp/wdr4300/root_file_system/etc/config/board | 2 - .../root_file_system/etc/rc.local.board | 18 - bsp/wdr4900/root_file_system/etc/config/board | 2 - .../root_file_system/etc/rc.local.board | 13 - 16 files changed, 1 insertion(+), 1315 deletions(-) delete mode 100755 bsp/default/root_file_system/etc/admin.sh delete mode 100755 bsp/default/root_file_system/etc/cache.sh delete mode 100755 bsp/default/root_file_system/etc/clients.sh delete mode 100755 bsp/default/root_file_system/etc/clients_event.sh delete mode 100644 bsp/default/root_file_system/etc/downup.sh delete mode 100755 bsp/default/root_file_system/etc/init.d/zapp delete mode 100755 bsp/default/root_file_system/etc/report.sh delete mode 100755 bsp/default/root_file_system/etc/serve.sh delete mode 100755 bsp/default/root_file_system/etc/statistics.sh delete mode 100755 bsp/default/root_file_system/etc/variable_splash.sh delete mode 100644 bsp/wdr4300/root_file_system/etc/config/board delete mode 100644 bsp/wdr4300/root_file_system/etc/rc.local.board delete mode 100644 bsp/wdr4900/root_file_system/etc/config/board delete mode 100644 bsp/wdr4900/root_file_system/etc/rc.local.board diff --git a/bsp/default/root_file_system/etc/admin.sh b/bsp/default/root_file_system/etc/admin.sh deleted file mode 100755 index 7513934..0000000 --- a/bsp/default/root_file_system/etc/admin.sh +++ /dev/null @@ -1,221 +0,0 @@ -#!/bin/ash - -# string check -check() { - local MODE="$1" - local STRING="$2" - local REGEXP= - local STRING_VALID= - [ -n "$2" ] || return 1 - case "$MODE" in - binary) - REGEXP="^[01]+$" - ;; - - bool) - REGEXP="^[01]$" - ;; - - direction) - REGEXP="^[NESW]{1,3}$" - ;; - - email) - REGEXP="^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" - ;; - - hostname) - REGEXP="^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$" - ;; - - httpurl) - REGEXP="^http(s?):\/\/[^ \"\(\)\<\>]*$" - ;; - - integer) - REGEXP="^[0-9]+$" - ;; - - numeric) - REGEXP="^[0-9]+(\.[0-9]+)?$" - ;; - - regexp) - REGEXP="$3" - ;; - - telephone) - REGEXP="^\+?[-0-9./() ]+$" - ;; - - simplestring) - REGEXP="^[-a-zA-Z0-9._ ]+$" - ;; - - esac - STRING_VALID=$(echo -n "$STRING" | grep -E "$REGEXP") - [ "$STRING" == "$STRING_VALID" ] || return 1 -} - -# command implementations -set_hostname() { - local HOSTNAME="$1" - check hostname "$HOSTNAME" || return 1 - uci set system.@system[0].hostname="$HOSTNAME" - uci commit - echo "$HOSTNAME" > /proc/sys/kernel/hostname -} - -set_wanratelimit() { - local UPLIMIT="$1" - local DOWNLIMIT="$2" - check integer "$UPLIMIT" || return 1 - check integer "$DOWNLIMIT" || return 1 - if [ "$UPLIMIT" -gt 0 ] && [ "$DOWNLIMIT" -gt 0 ]; then - uci set qos.wan.upload="$UPLIMIT" - uci set qos.wan.download="$DOWNLIMIT" - uci commit - /etc/init.d/qos stop - /etc/init.d/qos enable - /etc/init.d/qos start - else - /etc/init.d/qos stop - /etc/init.d/qos disable - fi -} - -upgrade_firmware() { - local URL="$1" - local MD5SUM="$2" - local BOARDNAME=$(uci get board.model.name) - [ -n "$BOARDNAME" ] || return 1 - if [ -z "$URL" ]; then - local UPGRADEPATH=$(uci get firmware.upgrade.path) - URL="${UPGRADEPATH}/${BOARDNAME}.bin" - fi - check httpurl "$URL" || return 1 - check regexp "$URL" "$BOARDNAME" || return 1 - check regexp "$URL" "upgrade" || return 1 - [ -n "$MD5SUM" ] || MD5SUM=$(wget -q -O - --no-check-certificate "$URL.md5" | cut -d" " -f1) - [ -n "$MD5SUM" ] || return 1 - wget -q -O /tmp/firmware-sysupgrade.bin --no-check-certificate "$URL" || return 1 - local MD5SUM_VALID=$(md5sum /tmp/firmware-sysupgrade.bin | cut -d" " -f1) - [ "$MD5SUM" == "$MD5SUM_VALID" ] || return 1 - sysupgrade /tmp/firmware-sysupgrade.bin -} - -set_upgradepath() { - local UPGRADEPATH="$1" - check httpurl "$UPGRADEPATH" || return 1 - uci set firmware.upgrade=upgrade || return 1 - uci set firmware.upgrade.path="$UPGRADEPATH" || return 1 - uci commit -} - -set_location() { - local LATITUDE="$1" - local LONGITUDE="$2" - local ELEVATION="$3" - check numeric "$LATITUDE" || return 1 - check numeric "$LONGITUDE" || return 1 - uci set site.location=location - uci set site.location.latitude="$LATITUDE" - uci set site.location.longitude="$LONGITUDE" - check numeric "$ELEVATION" && uci set site.location.elevation="$ELEVATION" - uci commit -} - -set_direction() { - local DIRECTION="$@" - DIRECTION=$(echo "$DIRECTION" | tr "nesw" "NESW") || return 1 - check direction "$DIRECTION" || return 1 - uci set site.location=location - uci set site.location.direction="$DIRECTION" - uci commit -} - -set_tags() { - local TAGS="$@" - TAGS=$(echo $TAGS | tr -s " ") - check simplestring "$TAGS" || return 1 - uci set site.location=location - uci set site.location.tags="$TAGS" - uci commit -} - -set_email() { - local EMAIL="$@" - check email "$EMAIL" || return 1 - uci set site.contact=contact - uci set site.contact.email="$EMAIL" - uci commit -} - -set_contact() { - local CONTACT="$@" - check simplestring "$CONTACT" || return 1 - uci set site.contact=contact - uci set site.contact.name="$CONTACT" - uci commit -} - -set_telephone() { - local TELEPHONE="$@" - check telephone "$TELEPHONE" || return 1 - uci set site.contact=contact - uci set site.contact.telephone="$TELEPHONE" - uci commit -} - -ACTION="$1" -shift - -case "$ACTION" in - hostname) - set_hostname $@ - ;; - - wanlimit) - set_wanratelimit $@ - ;; - - upgrade) - upgrade_firmware $@ - ;; - - upgradepath) - set_upgradepath $@ - ;; - - location) - set_location $@ - ;; - - direction) - set_direction $@ - ;; - - tags) - set_tags $@ - ;; - - email) - set_email $@ - ;; - - contact) - set_contact $@ - ;; - - telephone) - set_telephone $@ - ;; - - *) - echo "unknown action '$ACTION'" - exit 1 - ;; -esac - -# dont add anything here so we get the exit status of the action - diff --git a/bsp/default/root_file_system/etc/cache.sh b/bsp/default/root_file_system/etc/cache.sh deleted file mode 100755 index 47e29df..0000000 --- a/bsp/default/root_file_system/etc/cache.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/ash - -[ $# -ge 2 ] || exit 1 - -CACHEDIR='/tmp/cache' - -MAXAGE="$1" -shift 1 -COMMAND="$@" - -# generate an ID based on the command to be executed -ID=$(echo "$COMMAND" | md5sum | cut -d" " -f1) || exit 1 - -CACHED=false - -# create directory for cached output -[ -d "$CACHEDIR" ] || mkdir -p "$CACHEDIR" -[ -d "$CACHEDIR" ] || exit 1 - -# if there is an entry for the command to be executed... -if [ -f "$CACHEDIR/$ID/timestamp" ]; then - TIMESTAMP=$(cat "$CACHEDIR/$ID/timestamp") - CURRENTTIME=$(date +%s) - # ...check the timestamp and determine if it is sufficiently recent - if [ -n "$TIMESTAMP" ] && [ $(($CURRENTTIME-$TIMESTAMP)) -lt $MAXAGE ] && [ -f "$CACHEDIR/$ID/output" ]; then - CACHED=true - fi -fi - -# if there is cached output data just put it out... -if $CACHED; then - cat "$CACHEDIR/$ID/output" -else -# ...if not execute the command and save the output and a timestamp - [ -d "$CACHEDIR/$ID" ] || mkdir -p "$CACHEDIR/$ID" - $COMMAND | tee "$CACHEDIR/$ID/output" - date +%s > "$CACHEDIR/$ID/timestamp" -fi diff --git a/bsp/default/root_file_system/etc/clients.sh b/bsp/default/root_file_system/etc/clients.sh deleted file mode 100755 index ab010e7..0000000 --- a/bsp/default/root_file_system/etc/clients.sh +++ /dev/null @@ -1,16 +0,0 @@ -MESH_INTERFACE="br-mesh" -CLIENT_INTERFACES="wlan0" - -#CLIENTS -SEDDEV=`brctl showstp $MESH_INTERFACE | egrep '\([0-9]\)' | sed -e "s/(//;s/)//" | awk '{ print "s/^ "$2"/"$1"/;" }'` - -for entry in $CLIENT_INTERFACES; do - CLIENT_MACS=$CLIENT_MACS`brctl showmacs $MESH_INTERFACE | sed -e "$SEDDEV" | awk '{if ($3 != "yes" && $1 == "'"$entry"'") print $2}'`" " -done - -i=0 -for client in $CLIENT_MACS; do - i=`expr $i + 1` #Zähler um eins erhöhen -done - -echo $i diff --git a/bsp/default/root_file_system/etc/clients_event.sh b/bsp/default/root_file_system/etc/clients_event.sh deleted file mode 100755 index ff29ef9..0000000 --- a/bsp/default/root_file_system/etc/clients_event.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -i=`/etc/clients.sh` -wget -q -O - http://status.kreativitaet-trifft-technik.de/update/ff\?bootup=`date +%s`\&clients_count=$i - -while read LINE -do - if [ "`echo $LINE | grep 'wlan0: new station'`" != "" ]; then - i=`expr $i + 1` - wget -q -O - http://status.kreativitaet-trifft-technik.de/update/ff\?client_associated=`date +%s`\&clients_count=$i - fi - if [ "`echo $LINE | grep 'wlan0: unknown event 20'`" != "" ]; then - i=`expr $i - 1` - wget -q -O - http://status.kreativitaet-trifft-technik.de/update/ff\?client_disassociated=`date +%s`\&clients_count=$i - fi -done - - diff --git a/bsp/default/root_file_system/etc/crontabs/root b/bsp/default/root_file_system/etc/crontabs/root index 4b3df10..b7cbc69 100644 --- a/bsp/default/root_file_system/etc/crontabs/root +++ b/bsp/default/root_file_system/etc/crontabs/root @@ -1,4 +1,4 @@ -*/5 * * * * sh /etc/fastdstart.sh; sh /etc/nodewatcher.sh; sh /etc/configurator.sh; sh /etc/statistics.sh; sh /etc/wlanwatchdog.sh >> /var/log/wlanwatchdog.log 2>&1 +*/5 * * * * sh /etc/fastdstart.sh; sh /etc/nodewatcher.sh; sh /etc/configurator.sh; sh /etc/wlanwatchdog.sh >> /var/log/wlanwatchdog.log 2>&1 #15 01 * * * rdate -s time.fu-berlin.de > /dev/null diff --git a/bsp/default/root_file_system/etc/downup.sh b/bsp/default/root_file_system/etc/downup.sh deleted file mode 100644 index 556d341..0000000 --- a/bsp/default/root_file_system/etc/downup.sh +++ /dev/null @@ -1,19 +0,0 @@ -ipv6_link_local_addr="`ifconfig br-mesh | grep 'inet6 addr:' | grep 'Scope:Link' | awk '{ print $3}'`" - -ipv6_link_local_addr="`echo $ipv6_link_local_addr | cut -d/ -f1`" - -ping_result="`ping6 -I br-mesh $ipv6_link_local_addr`" - -ping_result="`echo $ping_result | grep 'bad address'`" - -ping_result="`$ping_result | awk '{ print $2}'`" - -echo $ping_result - -if [ "$ping_result"=="ping6\: sendto\: Cannot assign requested address" ]; then - echo "down" - ifconfig br-mesh down - ifconfig br-mesh up -else - echo "up" -fi diff --git a/bsp/default/root_file_system/etc/init.d/zapp b/bsp/default/root_file_system/etc/init.d/zapp deleted file mode 100755 index 08e7b33..0000000 --- a/bsp/default/root_file_system/etc/init.d/zapp +++ /dev/null @@ -1,622 +0,0 @@ -#!/bin/sh - -# If you got false positives, try a higher value -BOGOTHRESH=200 - -# Note: for mail alarm, you need "ssmtp" installed and configured. -# Example /etc/ssmtp/ssmtp.conf (debian/ubuntu) for GMX needs: -# mailhub=mail.gmx.net:25 FromLineOverride=YES -# AuthUser=$MAILFROM AuthPass=x UseSTARTTLS=YES -MAILFROM=sender-address@domain.de -MAILADDR=receiver-address@domain.de - -# Insert IPs you trust -#TRUSTEDIP="$TRUSTEDIP 1.2.3.4" -#TRUSTEDIP="$TRUSTEDIP 2.3.4.5" - -# 0: Do not save, 1: save conntrack if zapp -DEBUGSAVE=0 -# Empty: No log in /var/log/zapp/, otherwise string to prepend to saved bogothresh files -DEBUGLOGS= #$(date "+%b%d %H:%M") - -# 0: Manual clear, or minutes until auto-clear blockade (5-1439) -CLEARTIME=360 - -WEBSERVER=/www - -# --- END OF CONFIGURATION SETTINGS --- - -# This script uses case-esac for speed with busybox-ash. Current version under: -# http://ff-firmware.cvs.sourceforge.net/viewvc/*checkout*/ff-firmware/ff-devel/freifunk-zapp/etc/init.d/S92zapp - -# When running via cron, the PATH is unset -export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - -# We start a netcat-based webserver on this port if someone is blocked -BLOCKPORT=8090 - -CRONUSR=root -CRONDIR=/var/spool/cron/crontabs - -# First argument may be an input file -CONN=${1:-/proc/net/ip_conntrack} - -# This script calls itself with the IP to analyze why its blocking -DEBIP=$2 -case $1 in '')DEBUG=false;;*)DEBUG=true;;esac - -case $DEBUGLOGS in "");;*)test -d /var/log/zapp || mkdir -p /var/log/zapp;;esac - -# Find out our IP that is used to connect to the Internet -DEV=$(ip route get 1.1.1.1/1|sed -n '1{s/.* dev \([^ ]\+\).*/\1/;p}') -ADR=$(ip -f inet addr list dev $DEV scope global|sed -n '2s/^.*inet \([0-9\.]\+\).*/\1/p') -PAT=$(sed 's/\./_/g'<&1 | egrep -q '\-l\b' || NC_CMD= - -# 1=-I/-D 2=proto 3=srcip, 4=dport, 5=to -portfw () { - local to - case $1 in "-D") - to=$(iptables -t nat -nL PREROUTING|sed -n "s/^DNAT[[:space:]]\\+$2[[:space:]]\\+[^[:space:]]\\+[[:space:]]\\+$3[[:space:]]\\+![[:digit:]]\\+\\.[[:digit:]]\\+\\.[[:digit:]]\\+\\.[[:digit:]]\\+[[:space:]]\\+$2[[:space:]]\\+dpt:$4[[:space:]]\\+to://;tp;b;:p p;q") - ;;esac - to=${to:-$5} - iptables -t nat $1 PREROUTING --proto $2 -s $3 ! -d ${to%:*} --dport $4 -j DNAT --to $to -} - -netcatruns () { - for pid in $(pidof $NC_CMD);do - ppid=$(sed -n 's/^PPid: //p' /proc/$pid/status) - case $(sed -n 's/^Name: //p' /proc/$ppid/status) in ${0##*/}) - # Check netstat: release the IP currently grabbing our blocking page - case "$1" in "GET /let-me-browse-again"*) - le=$(printf "%02X%02X%02X%02X" $(echo ${ifip:-$ADR}|sed 's/\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)/\4 \3 \2 \1/')) - be=$(printf "%02X%02X%02X%02X" $(echo ${ifip:-$ADR}|sed 's/\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)/\1 \2 \3 \4/')) - eval $(sed -n '/^ *[0-9]\+: \+'$le':'$(printf '%04X' $BLOCKPORT)' \+[^ ]\+ \+01 \+/{s/^[^:]\+: \+[^ ]\+ \+\([^:][^:]\)\([^:][^:]\)\([^:][^:]\)\([^:][^:]\).*/ip=$(( 0x\4 )).$(( 0x\3 )).$(( 0x\2 )).$(( 0x\1 ))/;p;q};/^ *[0-9]\+: \+'$be':'$(printf '%04X' $BLOCKPORT)' \+[^ ]\+ \+01 \+/{s/^[^:]\+: \+[^ ]\+ \+\([^:][^:]\)\([^:][^:]\)\([^:][^:]\)\([^:][^:]\).*/ip=$(( 0x\1 )).$(( 0x\2 )).$(( 0x\3 )).$(( 0x\4 ))/;p;q}' /proc/net/tcp) - portfw -D tcp $ip 80 ${ifip:-$ADR}:$BLOCKPORT 2>&- - ;;esac - return 0 - ;;esac - done - return 1 -} - -# Add (-I) or remove (-D) iptables rules -block () { - # Freifunk Firmware Configs - which nvram && { - ff_adm_mail=$(nvram get ff_adm_mail) - ff_zapp_time=$(nvram get ff_zapp_time) - ff_zapp_debug=$(nvram get ff_zapp_debug) - ff_zapp_server=$(nvram get ff_zapp_server) - ff_zapp_strict=$(nvram get ff_zapp_strict) - MAILFROM=${ff_adm_mail:-$MAILFROM} - MAILADDR=${ff_adm_mail:-$MAILADDR} - CLEARTIME=${ff_zapp_time:-$CLEARTIME} - DEBUGSAVE=${ff_zapp_debug:-$DEBUGSAVE} - WEBSERVER=${ff_zapp_server:-$WEBSERVER} - IFS=\; - for i in $(nvram get ff_zapp_trusted); do - TRUSTEDIP="$TRUSTEDIP $i" - done - unset IFS - } - - for i in $TRUSTEDIP;do - case $2 in $i) - # Prevents re-blocking next run - iptables $1 FORWARD -s $2 - iptables $1 FORWARD -d $2 - return - ;;esac - done - - # Note: FreifunkFW does not have REJECT out-of-the-box - jump=DROP - iptables -I OUTPUT -d 127.0.0.1 -j REJECT 2>&- && iptables -D OUTPUT -d 127.0.0.1 -j REJECT 2>&- && jump=REJECT - - iptables $1 FORWARD -s $2 -j $jump - iptables $1 FORWARD -d $2 -j $jump - - # Allowing ping is always a good idea - iptables $1 FORWARD -s $2 --proto icmp -j ACCEPT - iptables $1 FORWARD -d $2 --proto icmp -j ACCEPT - - # Allow TCP up to port 1023 - iptables $1 FORWARD -s $2 --proto tcp --dport :1023 -j ACCEPT - iptables $1 FORWARD -d $2 --proto tcp --sport :1023 -j ACCEPT - - # Note: Freifunk FW does not have REDIRECT, use DNAT instead, - # which needs the correct outgoing interface IP for redirection. - ifip=$(ip route get $2|sed -n 's/^.* src \([^ ]\+\).*/\1/p') - - # Allow DNS, redirect to our local dnsmasq if applicable - if pidof dnsmasq >&-; then - portfw $1 udp $2 53 ${ifip:-$ADR}:53 - portfw $1 tcp $2 53 ${ifip:-$ADR}:53 - else - iptables $1 FORWARD -s $2 --proto udp --dport 53 -j ACCEPT - iptables $1 FORWARD -d $2 --proto udp --sport 53 -j ACCEPT - fi - - # It's polite to tell a blocked user what's going on - case $NC_CMD in "");;*) - portfw $1 tcp $2 80 ${ifip:-$ADR}:$BLOCKPORT 2>&- - case $1 in "-D") - case $CLEARTIME in ""|0);;*)test -f $CRONDIR/$CRONUSR && { - sed -i -e "/\/${0##*/} unblock $2\$/d" $CRONDIR/$CRONUSR - echo $CRONUSR > $CRONDIR/cron.update - };;esac - if ! iptables -t nat -nL PREROUTING|egrep -q "\\bto:[^:]+:$BLOCKPORT\\b"; then - netcatruns && (echo "Stopping netcat server" >&2;kill $ppid $pid) - fi - ;;*) - case $CLEARTIME in ""|0);;*)test -f $CRONDIR/$CRONUSR && { - min=$(date +%M) - min=$(( $(date +%k ) * 60 + ${min#0} + $CLEARTIME )) - me=$(echo $0|sed "s,^\\.\\.,$PWD/&,;s,^\\.,$PWD,") - sed -i -e "\$a$(( $min % 60 )) $(( $min / 60 % 24 )) * * * $me unblock $2" $CRONDIR/$CRONUSR - echo $CRONUSR > $CRONDIR/cron.update - };;esac - if ! netcatruns; then - echo "Starting netcat server for $2" >&2 - while true;do ($NC_CMD -l -p $BLOCKPORT < - Sorry... - - - - - - - - -

Zapped on $(uname -n) (${ifip:-$ADR})

- -
-

Deutsch: siehe untenfrançais : voir ci-dessous

-
-

Hello! You are a victim of a filesharing blockade. Your PC opens too - much connections to different Internet hosts. This may be caused by the - VoIP program Skype, by a filesharing program or by another program with - this unusual communication pattern. $(test -f $WEBSERVER/cgi-bin-skype.html && - echo "For operating the Skype VoIP program please read this - Information Page.") -

-

TCP based services still work (ports up to 1023), but UDP based services are blocked now.

-
-

The blockade $(case $CLEARTIME in ""|0) echo "needs to be removed manually.";;*)echo "will be - removed after $CLEARTIME minutes. Alternatively, the blockade can be removed manually.";;esac) - For this, send an email to $MAILADDR. -

-
- -
-
-

Hallo! Du bist das Opfer einer Filesharing-Sperre geworden. Dein Rechner - öffnet zuviele Verbindungen zu verschiedenen Internet-Rechnern. Dies - kann ausgelöst werden durch das VoIP-Programm Skype, durch ein - Filesharing-Programm oder durch ein anderes Programm welches dieses ungewöhnliche - Kommunikationsmuster aufweist. $(test -f $WEBSERVER/cgi-bin-skype.html && - echo "Zum Betrieb des VoIP-Programms Skype lies bitte diese - Informationsseite.") -

-

Hinweis: TCP-basierte Dienste (Ports bis 1023) funktionieren, aber UDP-basierte Dienste sind nun gesperrt.

-
-

Die Sperre $(case $CLEARTIME in ""|0)echo "muss manuell entfernt werden.";;*) - echo "wird nach $CLEARTIME Minuten entfernt. Wahlweise kann die Sperre - auch manuell entfernt werden.";;esac) Sende dazu eine Mail an - $MAILADDR. -

-
- -
-
-

Bonjour! Vous êtes victime du mécanisme de blocage de partage de fichiers. Votre - ordinateur ouvre trop de connexions simultanées vers trop d'hôtes Internet différents. - Ceci peut venir du logiciel de communications Skype, d'un logiciel de partage de fichiers, - ou d'un autre programme qui aurait ce même comportement inhabituel, comme certains virus. - $(test -f $WEBSERVER/cgi-bin-skype.html && - echo "Pour l'utilisation de Skype en voix sur IP (VoIP) merci de lire cette - page d'informations.") -

-

Précisions: Les services TCP restent fonctionnels (Ports jusqu'au n° 1023) mais les - services UDP sont bloqués. -

-

Le blocage $(case $CLEARTIME in ""|0)echo "doit être désactivé manuellement.";;*) - echo "sera levé automatiquement dans $CLEARTIME minutes. Il est aussi possible de - le faire manuellement.";;esac) en envoyant un mail à - $MAILADDR. -

-
- - - - - - -EOF - )|(read -r GET && netcatruns "$GET" && kill $pid) - done >&- 2>&- & - fi - ;;esac - ;;esac -} - -zapp () { - # Block an IP and send a mail to the admin - ip=$(echo $1|sed -e 's/^[A-Z]\+_//;s/=.*//;s/_/./g') - if $DEBUG; then - # Prevent script recursion - case $DEBIP in "") - echo "Zapping $(ip route get $ip|sed -n 's/ dev .*//p') with $2 bogopoints at $(date)" - echo - $0 "$CONN" ${1%=*} - ;;esac - elif ! iptables -nL FORWARD | egrep -q "\\b$(echo $ip|sed 's/\./\\&/g')\\b";then - echo "Zapping $(ip route get $ip|sed -n 's/ dev .*//p') with $2 bogopoints at $(date)" >> /var/log/zappfile.txt - mac=$(sed -n 's/^'$(echo $ip|sed 's/\./\\./g')' \+\([^ ]\+ \+\)\{2\}\([^ ]\+\).*/\2/p' /proc/net/arp) - - # Disabled, because we cannot unblock this currently - case 0 in 1)case $mac in '');;*) - echo "Also zapping $mac at $(date)" >> /var/log/zappfile.txt - iptables -I FORWARD -m mac --mac-source $mac -j $jump - ;;esac;;esac - - block -I $ip - - case $DEBUGSAVE in 1) - # Save current conntrack for later analysis - cat "$CONN"|gzip -c>/var/log/zappfile-$ip-$(date).txt.gz - ;;esac - - which ssmtp && cat|ssmtp $MAILADDR< $3:$4 (UNK=$UNK)";;esac - ;; - *) - case $4 in - 688*) - eval "case \$UNK_$1 in \"\")UNK=\$(( \$UNK + 5 ));;esac" - case $DEBIP in '');;*)echo "nak p2p $1:$2 -> $3:$4 (UNK=$UNK)";;esac - ;; - *) - eval "case \$UNK_$1 in \"\")UNK=\$(( \$UNK + 1 ));;esac" - case $DEBIP in '');;*)echo "nak udp $1:$2 -> $3:$4 (UNK=$UNK)";;esac - ;; - esac - ;; - esac - eval "UNK_$1=\$(( \$UNK_$1 + 1 ))" - ;;esac;;esac - # We only count traffic generated by others - case $3 in $PAT);;*) - case $4 in - # DNS: resolvers tend to open multiple connections - 53) - case ${10} in - "[UNREPLIED]") - eval "case \$UDP_$1_$3 in \"\")IP_$1=\$(( \$IP_$1 + 1 ));;esac";; - *) - eval "case \$UDP_$1_$3 in \"\")IP_$1=\$(( \$IP_$1 + 2 ));;esac";; - esac - case ${DEBIP#IP_} in $1)echo "udp ham $1:$2 $3:$4";;esac - ;; - # Punish traffic on ports 6880-6889 - 688*) - case ${10} in - "[UNREPLIED]") - eval "case \$UDP_$1_$3 in \"\")IP_$1=\$(( \$IP_$1 + 10 ));;esac";; - *) - eval "case \$UDP_$1_$3 in \"\")IP_$1=\$(( \$IP_$1 + 20 ));;esac";; - esac - case ${DEBIP#IP_} in $1)echo "udp p2p $1:$2 $3:$4";;esac - ;; - # Everything else is normal udp - *) - case ${10} in - "[UNREPLIED]") - eval "case \$UDP_$1_$3 in \"\")IP_$1=\$(( \$IP_$1 + 3 ));;esac";; - *) - eval "case \$UDP_$1_$3 in \"\")IP_$1=\$(( \$IP_$1 + 4 ));;esac";; - esac - case ${DEBIP#IP_} in $1)echo "udp std $1:$2 $3:$4";;esac - ;; - esac - eval "UDP_$1_$3=\$(( \$UDP_$1_$3 + 1 ))" - ;;esac - return 0 -} - -case $1 in - block) - case $2 in "")echo "Add IP as second arg" 2>&-;exit 1;;esac - block "-I" $2 - exit 0 - ;; - unblock|clear) - case $2 in "")echo "Add IP as second arg" 2>&-;exit 1;;esac - block "-D" $2 - exit 0 - ;; - start|stop) - test ! -f $CRONDIR/$CRONUSR && (echo "No $CRONDIR/$CRONUSR" 2>&-;exit 1) - if egrep -q "/${0##*/}" $CRONDIR/$CRONUSR; then - case $1 in stop) - echo "Removing ${0##*/} from cron" - sed -i -e "/\/${0##*/}/d" $CRONDIR/$CRONUSR - ;;esac - else - case $1 in start) - case $BOGOTHRESH in 0);;*) - echo "Adding ${0##*/} to cron" - me=$(echo $0|sed "s,^\\.\\.,$PWD/&,;s,^\\.,$PWD,") - sed -i -e "\$a*/1 * * * * $me" $CRONDIR/$CRONUSR - ;;esac - ;;esac - fi - echo $CRONUSR > $CRONDIR/cron.update - exit 0 - ;; - status) - echo "Firewall status:" - iptables -nL FORWARD|egrep '^(DROP|REJECT)? +all +-- +[1-9][0-9\.]+ +0.0.0.0/0\b' || echo " No IPs blocked" - egrep -q "/${0##*/}" $CRONDIR/$CRONUSR && echo "Running via cron" || echo "Not running via cron" - exit 0 - ;; - -h|--help|help) - cat<&2 - echo "Use 'sysctl -w net.netfilter.nf_conntrack_acct=1'" >&2 - exit 1 - fi -fi - -# Different kernels have differnt formats, script lines doubled to prevent too much compare operations -REL=$(uname -r) -case ${REL#2.4} in $REL) - # Kernel 2.6 output has [STATUS] in different positions, shift to end - sed 's/\./_/g;s/\( \[[^]]\+\]\)\(.*\)/\2\1/;$aeof' "$CONN"|while read l;do - set $l - case $1 in - tcp) - tcp ${5#src=} ${7#sport=} ${6#dst=} ${8#dport=} ${11#src=} ${13#sport=} ${12#dst=} ${14#dport=} $(( ${10#bytes=} + ${16#bytes=} )) $4 - ;; - udp) - udp ${4#src=} ${6#sport=} ${5#dst=} ${7#dport=} ${10#src=} ${12#sport=} ${11#dst=} ${13#dport=} $(( ${9#bytes=}+${15#bytes=} )) ${19} - ;; - eof) - # If probably no P2P client active double threshold - test $UNK -lt 10 && BOGOTHRESH=$(( $BOGOTHRESH + $BOGOTHRESH )) - set|sed -n "s/^\\(IP_[^=]\\+=\\)'*\\([^']\\+\\).*/\\1\\2/p"|while read i;do - case $DEBIP in ${i%=*})echo "$i -gt $BOGOTHRESH";;esac - case $DEBUGLOGS in "");;*)echo $DEBUGLOGS ${i#*=} >> /var/log/zapp/${i%=*};;esac - test ${i#*=} -gt $BOGOTHRESH && zapp $i ${i#*=} - done - ;; - esac - done -;;*) - # Kernel 2.4 output has [STATUS] in different positions, shift to end - sed 's/\./_/g;s/\( \[[^]]\+\]\)\(.*\)/\2\1/;$aeof' "$CONN"|while read l;do - set $l - case $1 in - tcp) - tcp ${5#src=} ${7#sport=} ${6#dst=} ${8#dport=} ${9#src=} ${11#sport=} ${10#dst=} ${12#dport=} ${15#bytes=} $4 - ;; - udp) - udp ${4#src=} ${6#sport=} ${5#dst=} ${7#dport=} ${8#src=} ${10#sport=} ${9#dst=} ${11#dport=} ${14#bytes=} ${15} - ;; - eof) - # If probably no P2P client active double threshold - test $UNK -lt 10 && BOGOTHRESH=$(( $BOGOTHRESH + $BOGOTHRESH )) - set|sed -n "s/^\\(IP_[^=]\\+=\\)'*\\([^']\\+\\).*/\\1\\2/p"|while read i;do - case $DEBIP in ${i%=*})echo "$i -gt $BOGOTHRESH";;esac - case $DEBUGLOGS in "");;*)echo $DEBUGLOGS ${i#*=} >> /var/log/zapp/${i%=*};;esac - test ${i#*=} -gt $BOGOTHRESH && zapp $i ${i#*=} - done - ;; - esac - done -;;esac - -exit 0 diff --git a/bsp/default/root_file_system/etc/rc.local.tpl b/bsp/default/root_file_system/etc/rc.local.tpl index 97b6e4d..41c2d11 100755 --- a/bsp/default/root_file_system/etc/rc.local.tpl +++ b/bsp/default/root_file_system/etc/rc.local.tpl @@ -36,9 +36,6 @@ ntpd -p ${NTPD_IP} mkdir /tmp/crawldata httpd -h /tmp/crawldata -# serve the 30s-cached output of "report.sh gzip" on port 81 with max 1 request/s -/etc/serve.sh 81 1 "/etc/cache.sh 30 /etc/report.sh gzip" & - touch /tmp/started exit 0 diff --git a/bsp/default/root_file_system/etc/report.sh b/bsp/default/root_file_system/etc/report.sh deleted file mode 100755 index 087309b..0000000 --- a/bsp/default/root_file_system/etc/report.sh +++ /dev/null @@ -1,247 +0,0 @@ -#!/bin/ash - -POSTPROC="$@" -[ -n "$POSTPROC" ] || POSTPROC="cat -" - -# functions -# prefixes all lines with a comma but the first one -comma() { - awk '{ if (NR >1) print ","$0; else print $0; }' -} - -# counts clients via bridge -# hardcoded interfaces br-mesh and wlan0 as they -# are the same on all routers -get_clients() { - local COUNT=0 - local DEVNUMBER= - DEVNUMBER=$(brctl showstp br-mesh |\ - awk '/^wlan0 / { gsub("[()]", "", $2); printf $2; exit}') - if [ -n "$DEVNUMBER" ]; then - COUNT=$(brctl showmacs br-mesh |\ - awk -v number=$DEVNUMBER ' - BEGIN {count=0} - {if ($1 == number && $3 == "no") count++} - END {print count}') - fi - echo $COUNT -} - -# generate a json report compatible with libremap 1.0 -report() { - # json - echo "{" - - # use lowercase MAC addr from br-mesh interface as id - local ID=$(ifconfig br-mesh |\ - grep -o -E "HWaddr[ ]+[0-9a-fA-F:]+" |\ - tr -s " " |\ - cut -d" " -f2 |\ - tr "ABCDEF" "abcdef") - local HOSTNAME=$(cat /proc/sys/kernel/hostname) - echo "\"_id\":\"${ID}\"" - echo ",\"api_rev\":1.0" - echo ",\"type\":\"router\"" - echo ",\"hostname\":\"${HOSTNAME}\"" - - # location - # latitude and longitude are required! - echo ",\"location\":{" - local LATITUDE=$(uci get site.location.latitude) - local LOGITUDE=$(uci get site.location.longitude) - local ELEVATION=$(uci get site.location.elevation 2>/dev/null) - echo "\"lat\":${LATITUDE}" - echo ",\"lon\":${LOGITUDE}" - echo ",\"ele\":${ELEVATION}" - echo "}" - # /location - - # aliases - # each mac adresses identifies the router - echo ",\"aliases\":[" - ip -o address show |\ - grep -o -E "link/ether [0-9a-fA-F:]+" |\ - tr -s " " |\ - cut -d" " -f2 |\ - sort -u |\ - tr "ABCDEF" "abcdef" |\ - awk '{print "{\"alias\":\""$0"\",\"type\":\"mac\"}"}' |\ - comma - echo "]" - # /aliases - - # links - echo ",\"links\":[" - batctl o |\ - grep -o -E "^([0-9a-f]{2}:?)+[ ]+[0-9.]+s[ ]+\([ 0-9]+\)[ ]+([0-9a-f]{2}:?)+[ ]+\[[^]]+\]" |\ - tr -d "s()[]" |\ - tr -s " " |\ - tr "ABCDEF" "abcdef" |\ - awk '{ - if ($1 == $4) { - type="unk" - if ($5 ~ /wlan/) type="wlan" - if ($5 ~ /eth/) type="eth" - if ($5 ~ /VPN/) type="vpn" - if ($5 ~ /vpn/) type="vpn" - quality=sprintf("%.2f",$3/255) - print "{\"alias\":\""$1"\",\"type\":\"mac\",\"quality\":"quality",\"attributes\":{\"type\":\""type"\"}}" - } - }' |\ - comma - echo "]" - # /links - - # attributes - echo ",\"attributes\":{" - - # contact - echo "\"contact\":{" - local CONTACT=$(uci get site.contact.name 2>/dev/null) - local EMAIL=$(uci get site.contact.email 2>/dev/null) - local TELEPHONE=$(uci get site.contact.telephone 2>/dev/null) - echo "\"name\":\"${CONTACT}\"" - echo ",\"email\":\"${EMAIL}\"" - echo ",\"telephone\":\"${TELEPHONE}\"" - echo "}" - # /contact - - # site - echo ",\"site\":{" - local DIRECTION=$(uci get site.location.direction) - local TAGS=$(uci get site.location.tags) - echo "\"direction\":\"${DIRECTION}\"" - echo ",\"tags\":\"${TAGS}\"" - echo "}" - # /site - - # system - echo ",\"system\":{" - local MODEL=$(uci get board.model.name) - local CPU=$(cat /proc/cpuinfo |\ - awk -F': ' '/^cpu model/ { print $2; exit}') - local MEMORY=$(cat /proc/meminfo |\ - awk -F" " '/^MemTotal:/ {print $2; exit}') - local FIRMWARE=$(cat /etc/*release |\ - grep "^FIRMWARE_VERSION=" |\ - cut -d= -f2 |\ - tr -d "'\"") - local DISTIBUTION=$(cat /etc/*release |\ - grep "^DISTRIB_DESCRIPTION=" |\ - cut -d= -f2 |\ - tr -d "'\"") - local LINUX=$(uname -r) - local BATMANADV=$(cat /sys/module/batman_adv/version) - local FASTD=$(fastd -v | cut -d" " -f2) - local WLANPOWER=$(iwconfig wlan0 |\ - grep -o -E "Tx-Power= *[0-9]+" |\ - cut -d= -f2) - [ -n "$WLANPOWER" ] || WLANPOWER=0 - echo "\"hardware\":{" - echo "\"model\":\"$MODEL\"" - echo ",\"cpu\":\"$CPU\"" - echo ",\"memory\":$MEMORY" - echo "}" - echo ",\"software\":{" - echo "\"firmware\":\"$FIRMWARE\"" - echo ",\"distribution\":\"$DISTIBUTION\"" - echo ",\"linux\":\"$LINUX\"" - echo ",\"batman-adv\":\"$BATMANADV\"" - echo ",\"fastd\":\"$FASTD\"" - echo "}" - echo ",\"wireless\":{" - echo "\"power\":$WLANPOWER" - echo "}" - echo "}" - # /system - - - # load - echo ",\"load\":{" - local UPTIME=$(cat /proc/uptime | cut -d" " -f1) - local CPU_LOAD=$(cat /proc/loadavg | cut -d" " -f2) - local MEMORY_LOAD=$(cat /proc/meminfo |\ - awk ' - /^MemTotal:/ {total=$2} - /^MemFree:/ {free=$2} - /^Buffers:/ {buffers=$2} - /^Cached:/ {cached=$2; exit} - END {printf "%.2f",(total-free-buffers-cached)/total} - ') - local TRAFFIC_MESH= - local TRAFFIC_WAN= - if [ -f '/var/statistics/traffic' ]; then - TRAFFIC_MESH=$(cat /var/statistics/traffic |\ - awk '/^bat0 / { printf "[%.2f,%.2f]",$4/1024,$2/1024}') - TRAFFIC_WAN=$(cat /var/statistics/traffic |\ - awk '/^[^ ]*(VPN|vpn)[^ ]* / { printf "[%.2f,%.2f]",$4/1024,$2/1024; exit }') - fi - [ -n "$TRAFFIC_MESH" ] || TRAFFIC_MESH=[0,0] - [ -n "$TRAFFIC_WAN" ] || TRAFFIC_WAN=[0,0] - local CLIENTS=$(get_clients) - MESH=$(batctl o |\ - tail -n+3 |\ - awk 'BEGIN {count=0;cumqual=0;} {gsub("[()]", "", $3); cumqual +=$3; count++;} END {printf "%.2f",(cumqual/(count*255))}') - [ -n "$MESH" ] || MESH=0 - echo "\"uptime\":$UPTIME" - echo ",\"cpu\":$CPU_LOAD" - echo ",\"memory\":$MEMORY_LOAD" - echo ",\"clients\":$CLIENTS" - echo ",\"mesh\":$MESH" - echo ",\"traffic\":{" - echo "\"mesh\":"$TRAFFIC_MESH - echo ",\"wan\":"$TRAFFIC_WAN - echo "}" - echo "}" - # /load - - # internet - # get data from selected or (if unavailable) best connected gw - echo ",\"internet\":{" - batctl gwl |\ - awk -F" " 'BEGIN { - gateway_sel="" - via_sel="" - quality_sel=0 - } - /Gateway/ { next } - /No gateways/ { next } - { - sub("^=>", "1", $0) - sub("^ ", "0", $0) - sub(" *\\( *", " ", $0) - sub(" *\\) *", " ", $0) - sub(" *\\[ *", " ", $0) - sub(" *\\]: *", " ", $0) - quality=sprintf("%.2f",$3/255) - if ($1 == 1) { - gateway_sel=$2 - via_sel=$4 - quality_sel=quality - exit - } else if (quality > quality_sel) { - gateway_sel=$2 - via_sel=$4 - quality_sel=quality - } - } - END { - print "\"alias\":\""gateway_sel"\"" - print ",\"type\":\"mac\"" - print ",\"quality\":"quality_sel - print ",\"via\":{" - print "\"alias\":\""via_sel"\"" - print ",\"type\":\"mac\"" - print "}" - }' - echo "}" - # /gateway - - echo "}" - # /attributes - - echo "}" - # /json -} - -report | $POSTPROC diff --git a/bsp/default/root_file_system/etc/serve.sh b/bsp/default/root_file_system/etc/serve.sh deleted file mode 100755 index 9022246..0000000 --- a/bsp/default/root_file_system/etc/serve.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/ash - -[ $# -ge 3 ] || exit 1 - -PORT="$1" -DELAY="$2" -shift 2 -COMMAND="$@" - -while true; do - (nc -l -p $PORT -e $COMMAND) > /dev/null 2>&1 - sleep $DELAY -done diff --git a/bsp/default/root_file_system/etc/statistics.sh b/bsp/default/root_file_system/etc/statistics.sh deleted file mode 100755 index 5122e7a..0000000 --- a/bsp/default/root_file_system/etc/statistics.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/ash - -# config -STATSDIR="/tmp/statistics" - -get_trafficdata() { - cat /proc/net/dev | tail -n +3 | tr ":" " " | sed -e 's/^[ ]\+//g' | tr -s " " | cut -d" " -f 1,2,3,10,11 || return 1 -} - -update_traffic() { - local TIME=$(date +%s) - local DATA=$(get_trafficdata) - local DATATMP= - local REFERENCE= - local REFERENCETMP= - local REFERENCE_TIME= - local DELTA= - local DEVICES= - if [ -f "$STATSDIR/traffic_reference_time" ] && [ -f "$STATSDIR/traffic_reference" ]; then - REFERENCE_TIME=$(cat "$STATSDIR/traffic_reference_time") - REFERENCE=$(cat "$STATSDIR/traffic_reference") - fi - if [ -n "$TIME" ] && [ -n "$REFERENCE_TIME" ]; then - DELTA=$(($TIME-$REFERENCE_TIME)) - fi - if [ -n "$DATA" ] && [ -n "$REFERENCE" ] && [ -n "$DELTA" ]; then - echo "#device rx[b/s] rx[p/s] tx[b/s] tx[p/s]" > "$STATSDIR/traffic.tmp" - DEVICES=$(echo "$DATA" | cut -d" " -f1 | sort -u) || return 1 - echo "$DEVICES" | while read DEVICE; do - if [ -n "$DEVICE" ] - then - DATATMP=$(echo "$DATA" | grep "^$DEVICE " | cut -d" " -f 2- | tr "\n" " ") || return 1 - REFERENCETMP=$(echo "$REFERENCE" | grep "^$DEVICE " | cut -d" " -f 2- | tr "\n" " ") || return 1 - echo "$DEVICE $DATATMP $REFERENCETMP" | tr -s " " | awk -F" " -v DELTA=$DELTA '{printf "%s %.0f %.0f %.0f %.0f\n",$1,($2-$6)/DELTA,($3-$7)/DELTA,($4-$8)/DELTA,($5-$9)/DELTA}' >> "$STATSDIR/traffic.tmp" || return 1 - fi - done - mv "$STATSDIR/traffic.tmp" "$STATSDIR/traffic" - fi - echo "$DATA" > "$STATSDIR/traffic_reference" - echo "$TIME" > "$STATSDIR/traffic_reference_time" -} - -# secure dot-scripts -[ -e "$STATSDIR" ] || mkdir -p "$STATSDIR" -[ -d "$STATSDIR" ] || exit 1 -chown -R root "$STATSDIR" -chmod -R 700 "$STATSDIR" - -# update values -update_traffic diff --git a/bsp/default/root_file_system/etc/variable_splash.sh b/bsp/default/root_file_system/etc/variable_splash.sh deleted file mode 100755 index 8b43cf5..0000000 --- a/bsp/default/root_file_system/etc/variable_splash.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# This script needs to be enabled within the rc.local with: -# iw event -f | /etc/clients_event.sh & - -API_IPV4_ADRESS=`uci get configurator.@api[0].ipv4_address` -API_IPV6_ADRESS=`uci get configurator.@api[0].ipv6_address` -API_IPV6_INTERFACE=`uci get configurator.@api[0].ipv6_interface` -CRAWL_ROUTER_ID=`uci get configurator.@crawl[0].router_id` - -get_url() { - if [[ $API_IPV4_ADRESS != "1" ]]; then - url=$API_IPV4_ADRESS - else - url="[$API_IPV6_ADRESS"%"$API_IPV6_INTERFACE]" - fi - echo $url -} - -netmon_api=`get_url` - -while read LINE -do - if [ "`echo $LINE | grep 'wlan0: new station'`" != "" ]; then - mac_addr="`echo $LINE | grep 'wlan0: new station' | cut -d' ' -f4`" - - command="wget -q -O - http://$netmon_api/api_csv_variable_splash.php?section=insert_client&router_id=$CRAWL_ROUTER_ID&mac_addr=$mac_addr" - api_return=`$command` - echo "$api_return" - fi -done - - diff --git a/bsp/wdr4300/root_file_system/etc/config/board b/bsp/wdr4300/root_file_system/etc/config/board deleted file mode 100644 index 8f1c36e..0000000 --- a/bsp/wdr4300/root_file_system/etc/config/board +++ /dev/null @@ -1,2 +0,0 @@ -config model 'model' - option name 'wdr4300' diff --git a/bsp/wdr4300/root_file_system/etc/rc.local.board b/bsp/wdr4300/root_file_system/etc/rc.local.board deleted file mode 100644 index 3e14c6f..0000000 --- a/bsp/wdr4300/root_file_system/etc/rc.local.board +++ /dev/null @@ -1,18 +0,0 @@ -if [[ "$(cat /var/sysinfo/board_name)" = "tl-wdr3500" ]]; then - WLAN0_MACADDR=$(cat /sys/class/net/w2mesh/address) -else - WLAN0_MACADDR=$(cat /sys/class/net/w5mesh/address) -fi - -BRMESH_MACADDR=$(cat /sys/class/net/br-mesh/address) - -if [[ "$WLAN0_MACADDR=" != "$BRMESH_MACADDR=" ]]; then - echo "Fixing wrong MAC on br-mesh" - uci set network.mesh.macaddr=$WLAN0_MACADDR - uci commit - ifconfig br-mesh hw ether $WLAN0_MACADDR - ifconfig br-mesh down - ifconfig br-mesh up -fi - -# vim: noexpandtab diff --git a/bsp/wdr4900/root_file_system/etc/config/board b/bsp/wdr4900/root_file_system/etc/config/board deleted file mode 100644 index 5f98199..0000000 --- a/bsp/wdr4900/root_file_system/etc/config/board +++ /dev/null @@ -1,2 +0,0 @@ -config model 'model' - option name 'wdr4900' diff --git a/bsp/wdr4900/root_file_system/etc/rc.local.board b/bsp/wdr4900/root_file_system/etc/rc.local.board deleted file mode 100644 index 566caf9..0000000 --- a/bsp/wdr4900/root_file_system/etc/rc.local.board +++ /dev/null @@ -1,13 +0,0 @@ -WLAN0_MACADDR=$(cat /sys/class/net/w5mesh/address) -BRMESH_MACADDR=$(cat /sys/class/net/br-mesh/address) - -if [[ "$WLAN0_MACADDR=" != "$BRMESH_MACADDR=" ]]; then - echo "Fixing wrong MAC on br-mesh" - uci set network.mesh.macaddr=$WLAN0_MACADDR - uci commit - ifconfig br-mesh hw ether $WLAN0_MACADDR - ifconfig br-mesh down - ifconfig br-mesh up -fi - -# vim: noexpandtab