#!/bin/ash if [ -f ../etc/mojo_mesh ] then echo "MojoMesh initialization already completed."; echo "Remove /etc/mojo_mesh and rerun mm_init_v2.x to force reinit."; exit fi if [ "$1" != "" ] then if [ "$2" != "" ] then if [ "$3" != "" ] then if [ "$4" != "" ] then if [ "$5" != "" ] then if [ "$6" != "" ] then nvram unset lan_ifnames nvram set lan_ifname=vlan0 # MUST BE vlan2 for G v1.1 router!! nvram set wifi_ifname=eth1 # MUST BE eth2 for G V1.1 router! nvram set wifi_proto=static nvram set wifi_ipaddr=$1 nvram set wifi_netmask=$2 nvram set wl0_mode=sta nvram set wl0_infra=0 nvram set wl0_ssid=$3 nvram set wl0_channel=$4 nvram set security_mode=wep nvram set wl0_wep_bit=$5 nvram set wl0_key1=$6 nvram set wl0_key=1 nvram set wl0_closed=1 nvram set router_name=`nvram get wifi_ipaddr | sed 's/[^0-9]/-/g'` nvram set wan_hostname=`nvram get router_name` nvram set mm_map=$7 nvram set mm_x=$8 nvram set mm_y=$9 cp /etc/olsrd.conf.gateway.v2.x /etc/olsrd.conf.gateway cp /etc/olsrd.conf.node.v2.x /etc/olsrd.conf.node rm /etc/olsrd.conf.*.v1.x touch ../etc/mojo_mesh echo "run nvram commit to save options, then reboot to enact them"; exit fi fi fi fi fi fi echo "usage: mm_init_v2.x "; echo ""; echo "example: mm_init_v2.x 10.43.1.7 255.255.0.0 big_mesh 11 64 1234567890"; echo ""; echo "note: all ips s/b different, all netmasks, ssids, channels,"; echo "number of wep bits, and wep keys s/b the same. web_bits can"; echo "be 64 or 128, wep_key s/b HEX but should NOT have '0x' before it.";