#!/bin/sh ### # # FreeWLAN Addons - http://www.freewlan.info # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA # # http://www.gnu.org/copyleft/gpl.html # ### echo "`uptime | awk -F" " '{print $1}'`: entering $0" >>/tmp/.startup_log if [ -f /etc/config/startup-commands ]; then echo "`uptime | awk -F" " '{print $1}'`: Executing self specified commands for startup now:" >>/tmp/.startup_log echo "`cat /etc/config/startup-commands | grep -v "!/bin/sh"`" >>/tmp/.startup_log /etc/config/startup-commands fi ( echo "`uptime | awk -F" " '{print $1}'`: waiting for internet connection..." >>/tmp/.startup_log while [ -z "$(/usr/bin/wget "http://updates.fon.com/firmware/conncheck/conncheck.txt" -O-)" ]; do sleep 5 done echo "`uptime | awk -F" " '{print $1}'`: internet connection detected" >>/tmp/.startup_log ntpclient -s -h pool.ntp.org && echo "`uptime | awk -F" " '{print $1}'`: time sync completed" >>/tmp/.startup_log . /etc/functions.sh . /tmp/network-config config_load mailservice config_get rebootcheck mail rebootcheck config_get to mail to config_load fon config_get essid public essid if enabled $rebootcheck;then MAIL_TO="$to"; macaddress=`ifconfig eth0 |grep HWaddr|awk {'print $5'}`; datestr=`date +%A", at "%R" (UTC) ("%F")"` echo -e " The device with MAC address $macaddress was restarted on $datestr. DATE $(date) ESSID $essid Hostname `cat /etc/hostname` Status URL(WAN side) http://$(ifconfig $wan_ifname 2>/dev/null | grep inet | awk -F'[: ]+' '{print $4}')/cgi-bin/webif/status.sh Status URL(LAN side) http://$(ifconfig $lan_ifname 2>/dev/null | grep inet | awk -F'[: ]+' '{print $4}')/cgi-bin/webif/status.sh " |mail "Fonera: (`cat /etc/hostname`) RebootCheck" "$MAIL_TO" fi ) &