Italiano English
Modifica History Actions

Differenze per "NinuxUciScript"

Differenze tra le versioni 4 e 5
Versione 4 del 2010-12-19 17:09:08
Dimensione: 2013
Autore: ZioPRoTo
Commento:
Versione 5 del 2010-12-19 17:12:01
Dimensione: 2030
Autore: ZioPRoTo
Commento: aggiunto mdns, spostate variabili in alto
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 14: Linea 14:
LANIP=192.168.1.1
LANNET=192.168.1.0
LANMASK=255.255.255.0
LANGW=""
Linea 29: Linea 33:
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
uci set network.lan.ipaddr=$LANIP
uci set network.lan.netmask=$LANMASK
uci set network.lan.gateway=$LANGW
uci set network.lan.dns=8.8.8.8
Linea 42: Linea 46:
uci set wireless.$DEVICE.txpower=20 #uci set wireless.$DEVICE.txpower=20
Linea 50: Linea 54:
#TODO: add mdns config
Linea 62: Linea 65:
uci set olsrd.@Hna4[-1].netaddr=192.168.3.0
uci set olsrd.@Hna4[-1].netmask=255.255.255.0
uci set olsrd.@Hna4[-1].netaddr=$LANNET
uci set olsrd.@Hna4[-1].netmask=$LANMASK

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"
LANIP=192.168.1.1
LANNET=192.168.1.0
LANMASK=255.255.255.0
LANGW=""

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=$LANIP
uci set network.lan.netmask=$LANMASK
uci set network.lan.gateway=$LANGW
uci set network.lan.dns=8.8.8.8

#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.0.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

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=$LANNET
uci set olsrd.@Hna4[-1].netmask=$LANMASK
uci set olsrd.@LoadPlugin[0]=LoadPlugin
uci set olsrd.@LoadPlugin[0].library=olsrd_mdns.so.1.0.0
uci set olsrd.@LoadPlugin[0].NonOlsrIf=lan


uci commit

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