#!/bin/bash
# Copyright 2013 Monterey Bay Aquarium Research Institute, all rights reserved.


# Get power port and serial port from configuration
radio=wifi
powerSerial=`python /home/hotspot/smc-script/modemConfig.py $MODEM_CONFIG_FILE $radio`
if [ $? != 0 ]; then
   echo $powerSerial
   echo Could not get configuration for $radio radio
   exit 1
fi

# Get power port
powerPort=`echo $powerSerial | awk '{print $1}'`

# No serial port...

# Turn on WiFi radio
echo Turning WiFi radio on
/home/smc/bin/SetPowerSwitch $powerPort 1

# Wait for radio to power up
sleep 5

/home/smc/bin/EnableEthernet

# Enable route to LRAUVs
echo 'Enable route to LRAUVs'
route add -net 134.89.95.0 netmask 255.255.255.0 eth0

