Italiano English
Modifica History Actions

Differenze per "NinuxUciScript"

Differenze tra le versioni 1 e 2
Versione 1 del 2010-12-05 23:21:36
Dimensione: 1710
Autore: ZioPRoTo
Commento:
Versione 2 del 2010-12-06 09:49:35
Dimensione: 1872
Autore: host252-231-dynamic
Commento:
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 1: Linea 1:
Linea 25: Linea 24:
#disable default bridge on lan
uci delete network.lan.type
Linea 26: Linea 27:
uci delete network.lan.type #TODO: move this config to variables on top of script
Linea 33: Linea 34:
#TODO: move this config to variables on top of script
Linea 49: Linea 50:
#TODO: add mdns config

Ninux Uci Script

set -a

/etc/init.d/dnsmasq stop
/etc/init.d/dnsmasq disable

/etc/init.d/firewall stop
/etc/init.d/firewall disable

HOSTNAME="zioprotowrt"
WLANIP="172.16.40.3"

CHANNEL="8"
ESSID="ninux.org"

sysctl -w kernel.hostname=$HOSTNAME
uci set system.@system[0].hostname=$HOSTNAME

DEVICE=`uci get wireless.@wifi-iface[0].device`
uci delete wireless.$DEVICE.disabled

#disable default bridge on lan
uci delete network.lan.type

#TODO: move this config to variables on top of script
uci set network.lan.proto=static
uci set network.lan.ipaddr=192.168.3.2
uci set network.lan.netmask=255.255.255.0
uci set network.lan.gateway=192.168.3.214
uci set network.lan.dns=192.168.3.214

#TODO: move this config to variables on top of script
uci set network.wlan=interface
uci set network.wlan.proto=static
uci set network.wlan.ipaddr=$WLANIP
uci set network.wlan.netmask=255.255.255.0

uci set wireless.$DEVICE.channel=$CHANNEL
uci set wireless.$DEVICE.disabled=0
uci set wireless.$DEVICE.txpower=20

uci set wireless.@wifi-iface[0].network=wlan
uci set wireless.@wifi-iface[0].mode=adhoc
uci set wireless.@wifi-iface[0].ssid=$ESSID
uci set wireless.@wifi-iface[0].encryption=none
uci set wireless.@wifi-iface[0].bgscan=0

#TODO: add mdns config
uci add olsrd olsrd
uci set olsrd.@olsrd[0].IpVersion=4
uci set olsrd.@olsrd[0].DebugLevel=0
uci add olsrd LoadPlugin
uci set olsrd.@LoadPlugin[0]=LoadPlugin
uci set olsrd.@LoadPlugin[0].library=olsrd_txtinfo.so.0.1
uci set olsrd.@LoadPlugin[0].accept="0.0.0.0"
uci add olsrd Interface
uci set olsrd.@Interface[0]=Interface
uci set olsrd.@Interface[0].interface=wlan
uci add olsrd Hna4
uci set olsrd.@Hna4[-1].netaddr=192.168.3.0
uci set olsrd.@Hna4[-1].netmask=255.255.255.0


uci commit

[ -x /etc/init.d/olsrd ] && /etc/init.d/olsrd enable