#
# OpenWISP Firmware
#
# Copyright (C) 2012 OpenWISP.org
#
#                     ......,,,,..............................
#                     ....====:::.............................
#                     ..,======~~....................:,,,.....
#                     ..,=========.................:~::===....
#                     ..,:::~===++................==~======...
#                     ...:::::===?I..............++========,..
#                     ....~::::+7+7.............I?+++==::=:...
#                     ......:::,++ 7...........7I++++:::::....
#                     .......:::+++ ..........? ++7,::::~.....
#                     ........:~~??7.......... ???::::,.......
#                     .........,~=?7 ...7....7???:::..........
#                     ..........===?7... ... I?~~~............
#                     ...........==?7.. I...7I===.............
#                     ...........~~~I. ..7.7I==...............
#                     ............::? ...  I~~................
#                     ...........::::.....I:::................
#                     .........::::........:::................
#                     .....===,:,+..........::+...............
#                     .....==:,+............,,:+..............
#                     ......~==..............+?::++...........
#                     ......=.................++:==...........
#                     .........................===............
#                     ...=......................=.=...........
#                     ...........................=............
##############################| http://openwisp.org |############################## 

#TODO: Make inner server configurable

The openwrt supported platfrom are: 
adm5120
ar7
ar71xx
atheros heavely tested
au1000
avr32
brcm-2.4
brcm47xx
ifxmips
ixp4xx
magicbox
ppc40x
ppc44x
rb532
rdc
x86

If you have some troubles please read our wiki.
In order to run deployment script you have to configure you server (sample configuration 
in server folder) if you don't have an atheros platform please change it in the 
configwrt.minimal file or compile it yourself. 

In order to configure an AP via web you can reach it at http://172.22.33.1:8080/
or via ssh doing ssh -l root 172.22.33.1 but the web way is higly recomended.

Default ssh password will be "ciaociao" 

If you want to customize the firmware you have to modify common.sh file, 
you can put your own VPN certificates openvpn folder. If certs are present 
during the deploy the server configurarion page will be hidden. 

Usage Example:

./deploy-firmware.sh -s /path/to/sources -a arch [OPTION]

Options explained: 

-h: Prints help and exit
-s: OpenWrt sources path is the exploded OpenWRT tarball
-a: Architecture e.g. atheros or another supported platform 
-v: Vpn server sets the IP address or the domain name of your OWM server 
-w: Default wpa-psk changes the default wpa key of your access point defaul one is owm-Ohz6ohngei 
    a wpa-psk key must be of 14chars
-e: Configuration essid changes the default "owispmanager-setup" ssid
-i: Inner server changes the default inner server where ap's can download the configuration default ip 
    is 10.8.0.1
-p: Inner server http port default is 80
-P: Root password root account must have a password if you want do disable telnet and enable ssh access. the default 
   one is ciaociao, and it is extremely weak. We suggest to chage it when deploy.

If you want to flash an abocom via telnet and redboot you can use utils/flash_abocom.exp expect script 
Just launch ./utils/flash_abocom.exp and power on your abocom
