#!/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 # ### if [ ! -f /etc/debug ]; then exit 0 fi . /etc/functions.sh config_load mailservice config_get fonupdatecheck mail fonupdatecheck config_get to mail to if enabled $fonupdatecheck;then . /tmp/network-config updatefiles="$(ls /www/updates/thinclient* 2>/dev/null)" if [ -n "$updatefiles" ]; then for file in $updatefiles ; do filename=${file##*/} filesize=$(ls -l $file | tr -s " " | cut -d " " -f 5) liststring=$liststring"\n"$filename"\t"$filesize" bytes"; done MAIL_TO="$to"; ipaddress=`ifconfig $wan_ifname |grep inet|cut -d":" -f2|cut -d" " -f1`; echo -e " There are Updates from FON available. Here is the list: $liststring To verify and execute these updates use the URL: http://$ipaddress/cgi-bin/webif/fonupdate.sh " |mail "Fonera: fonUpdateCheck" "$MAIL_TO" fi fi