Italiano English
Modifica History Actions

Differenze per "NinuxUciScript"

Differenze tra le versioni 3 e 7 (in 4 versioni)
Versione 3 del 2010-12-19 17:04:57
Dimensione: 1870
Autore: ZioPRoTo
Commento:
Versione 7 del 2010-12-26 14:09:41
Dimensione: 2148
Autore: ZioPRoTo
Commento:
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 17: Linea 21:
BSSID="02:02:CA:FE:CA:FE"
Linea 29: Linea 34:
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 47:
uci set wireless.$DEVICE.txpower=20 #uci set wireless.$DEVICE.txpower=20
Linea 49: Linea 54:

#TODO: add mdns config
uci set wireless.@wifi-iface[0].bssid=$BSSID
rm /etc/config/olsrd
touch /etc/config/olsrd
Linea 62: Linea 68:
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
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

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"
BSSID="02:02:CA:FE:CA:FE"

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 set wireless.@wifi-iface[0].bssid=$BSSID
rm /etc/config/olsrd
touch /etc/config/olsrd
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