Log in

fumaçaonline-1607 [r49403]

Name
1607
Network
fumaçaonline
Description
upgrading to chaos calmer
OpenWrt revision
r49403
Creation date
Oct. 29, 2016, 8:26 p.m.
Created by
annalinecurado
Admins
gui, al, brunovianna, hbm, Akil, noploop, annalinecurado, carmen
compare with
Last cook with success for this profile was 2 years, 2 months ago.

SSH Keys

al-eeprom, gui-gui@deltalibre, brunovianna-brunovianna, noploop-noploop, brunovianna-hp nobo, brunovianna-hp toque, hbm-note

Packages

lime-full
-rdisc6
-reghack
-6relayd
-dnsmasq
-ppp
-ppp-mod-pppoe
-firewall
-odhcpd
-odhcp6c

Files

/etc/uci-defaults/93_dns-alias-for-anygw

#!/bin/sh

### Uncomment to create additional alias equivalent to thisnode.info
### (useful for adapting to local language)
#sed -i '\|^address=/anygw/|{p;s|^address=/anygw/|address=/tplinklogin.net/|}' /etc/dnsmasq.d/*
sed -i '\|^address=/anygw/|{p;s|^address=/anygw/|address=/thisnode.info/|}' /etc/dnsmasq.d/*




/etc/config/libremap

config libremap 'settings'
        list api_url 'http://libremap.net/api'
        option community '{{NETWORK_NAME}}'
	option community_lat '-22.29'
	option community_lon '-44.31'
        option fetch_by_name '1'

config plugin 'location'
        option enabled '1'
        option elev '700'
        option latitude '-22.29'
        option longitude '-44.31'

config plugin 'system'
        option enabled '1'

config plugin 'wireless'
        option enabled '1'

config plugin 'contact'
        option enabled '0'
        option name 'Bruno Vianna'
        option email 'bruno@pobox.com'

/etc/uci-defaults/95_add-sshkeys

#!/bin/sh

sshkeys="
{{SSH_KEYS}}
"
 
authkeys="/etc/dropbear/authorized_keys"
umask 077 ; mkdir -p $(dirname $authkeys) ; touch $authkeys
IFS="
"    
for key in $sshkeys ; do
  sed "\|^$key$|d" -i $authkeys
  echo   "$key"    >> $authkeys
done                           

/etc/config/lime-defaults

# Beware this file is NOT supposed to be edited by the end user, modify /etc/config/lime instead
# If the same option or list is defined both in /etc/config/lime and lime-defaults file, the former will prevail
# Beware this file is not supposed to store interface specific configuration, like "config net eth0"

# Read the documentation in /etc/config/lime.example file
# and on https://libremesh.org

config lime system
        option hostname 'LiMe-%M4%M5%M6'
        option domain 'rede.fumacaonline.org.br'

config lime network
        option primary_interface eth0
        option main_ipv4_address '10.7.0.0/16/17'
        option main_ipv6_address '2a00:1508:0a%N1:%N200::/64'
        list protocols adhoc
        list protocols lan
        list protocols anygw
        list protocols batadv:%N1
        list protocols bmx6:13
        list protocols olsr:14
        list protocols olsr6:15
        list protocols olsr2:16
        list resolvers 4.2.2.2   # b.resolvers.Level3.net
        list resolvers 141.1.1.1 # cns1.cw.net
        list resolvers 2001:470:20::2 # ordns.he.net

config lime wifi
        option channel_2ghz '11'
        option channel_5ghz '48'
        option htmode_5ghz 'HT40'
        list modes 'ap'
        list modes 'apname'
        list modes 'adhoc'
        option ap_ssid '{{NETWORK_NAME}}'
        option apname_ssid '{{NETWORK_NAME}}/%H'
        option adhoc_ssid 'LiMe'
        option adhoc_bssid 'ca:fe:00:c0:ff:ee'
        option adhoc_mcast_rate_2ghz '24000'
        option adhoc_mcast_rate_5ghz '6000'
        option ieee80211s_mesh_fwding '0'
        option ieee80211s_mesh_id 'LiMe'

/etc/uci-defaults/95_reboot-daily

#!/bin/sh

### Uncomment to schedule a daily reboot at 6:00am
mkdir -p /etc/crontabs ; touch /etc/crontabs/root
sed "\| \* \* \* .*reboot$|d" -i /etc/crontabs/root
echo "0 6 * * * sleep 70; touch /etc/banner; reboot" >> /etc/crontabs/root

/usr/bin/offline-redirect.sh

#!/bin/sh
# script to check if there is internet connection
# if there isn't, all traffic will be redirected to local server
# fumaça online feature

if ! ip route | grep -q -e default # if there is no route out, then... 
then
#  offline; check if redirect is already there 

   if ! grep -q address=/#/10.7.128.10 /etc/dnsmasq.d/lime-proto-anygw-10-ipv4.conf
   then
      echo "address=/#/10.7.128.10">> /etc/dnsmasq.d/lime-proto-anygw-10-ipv4.conf 
      echo "added line"
      sleep 5
      /etc/init.d/dnsmasq restart
   fi
else
#if online, delete that line in case it is there 
   if sed -i '\|address=/#/10.7.128.10|d' /etc/dnsmasq.d/lime-proto-anygw-10-ipv4.conf 
   then 
      sleep 5
      /etc/init.d/dnsmasq restart
   fi
   echo "tried to delete line"
fi




/etc/uci-defaults/96_offline-redirect-crontab

#!/bin/sh

#changes permissions on offline script
chmod u+x /usr/bin/offline-redirect.sh

### Checks every minute if there is internet. Otherwise redirects

echo "* * * * * /usr/bin/offline-redirect.sh" >> /etc/crontabs/root

/etc/uci-defaults/95_snmpd

#!/bin/sh

#location="$(uci -q get lime.system.location || uci -q get lime-defaults.system.location)"
#contact="$(uci -q get lime.system.contact || uci -q get lime-defaults.system.contact)"

#uci delete snmpd.@system[0].sysName
#uci set snmpd.@system[0].sysLocation="$location"
#uci set snmpd.@system[0].sysContact="$contact"
#uci set snmpd.@agent[0].agentaddress='UDP:161,UDP6:161'
#uci set snmpd.public6=com2sec6
#uci set snmpd.public6.secname=ro
#uci set snmpd.public6.source=default
#uci set snmpd.public6.community=public
#uci commit snmpd

/etc/uci-defaults/95_set-timezone

#!/bin/sh

### Uncomment to set the correct timezone of all nodes
### You can check out all the possible values at:
### http://wiki.openwrt.org/doc/uci/system#time_zones
uci set system.@system[0].timezone="BRT3BRST,M10.3.0/0,M2.3.0/0"
uci set system.@system[0].zonename="America/Sao Paulo"
uci commit system

/etc/chef_version

20160913_2312

/etc/uci-defaults/95_set-remote-syslog

#!/bin/sh

### Uncomment to send UDP syslog packets through network
#if ! uci -q get system.@system[0].log_ip > /dev/null ; then
#    uci set system.@system[0].log_ip="10.4.0.2"
#    uci commit system
#fi

/etc/uci-defaults/97_add-localserver-to-hosts

#!/bin/sh

### Adds local server do /etc/hosts

echo "10.7.128.10 www" >> /etc/hosts