#!/bin/sh . /var/run/freifunk_register.conf echo "receiving GUI files over the network..." if [ -n "$FREIFUNK_GUI_PAGE_DLURL" ]; then if [ -n "$FREIFUNK_GUI_TEXT_BEFORE_FILE" ]; then wget -q -O $FREIFUNK_GUI_PAGE_LOCAL/custom/$FREIFUNK_GUI_TEXT_BEFORE_FILE.tmp - $FREIFUNK_GUI_PAGE_DLURL/$FREIFUNK_GUI_TEXT_BEFORE_FILE if [ -f $FREIFUNK_GUI_PAGE_LOCAL/custom/$FREIFUNK_GUI_TEXT_BEFORE_FILE.tmp ] #file is present? then cp $FREIFUNK_GUI_PAGE_LOCAL/custom/$FREIFUNK_GUI_TEXT_BEFORE_FILE.tmp /srv/www2/$FREIFUNK_GUI_TEXT_BEFORE_FILE else rm -f $FREIFUNK_GUI_PAGE_LOCAL/custom/$FREIFUNK_GUI_TEXT_BEFORE_FILE.tmp fi fi if [ -n "$FREIFUNK_GUI_TEXT_AFTER_FILE" ]; then wget -q -O $FREIFUNK_GUI_PAGE_LOCAL/custom/$FREIFUNK_GUI_TEXT_AFTER_FILE.tmp - $FREIFUNK_GUI_PAGE_DLURL/$FREIFUNK_GUI_TEXT_AFTER_FILE if [ -f $FREIFUNK_GUI_PAGE_LOCAL/custom/$FREIFUNK_GUI_TEXT_AFTER_FILE.tmp ] #file is present? then cp $FREIFUNK_GUI_PAGE_LOCAL/custom/$FREIFUNK_GUI_TEXT_AFTER_FILE.tmp /srv/www2/$FREIFUNK_GUI_TEXT_AFTER_FILE else rm -f $FREIFUNK_GUI_PAGE_LOCAL/custom/$FREIFUNK_GUI_TEXT_AFTER_FILE.tmp fi fi if [ -n "$FREIFUNK_GUI_PIC_FILE" ]; then wget -q -O $FREIFUNK_GUI_PAGE_LOCAL/custom/$FREIFUNK_GUI_PIC_FILE.tmp - $FREIFUNK_GUI_PAGE_DLURL/$FREIFUNK_GUI_PIC_FILE if [ -f $FREIFUNK_GUI_PAGE_LOCAL/custom/$FREIFUNK_GUI_PIC_FILE.tmp ] #file is present? then cp $FREIFUNK_GUI_PAGE_LOCAL/custom/$FREIFUNK_GUI_PIC_FILE.tmp /srv/www2/$FREIFUNK_GUI_PIC_FILE else rm -f $FREIFUNK_GUI_PAGE_LOCAL/custom/$FREIFUNK_GUI_PIC_FILE.tmp fi fi fi # Laufvariable fuer % Variablen idx=1 # Iteriere ueber alle Variablen und speichere ihren # Inhalt in eine Datei while [ "$idx" -le "$FREIFUNK_GUI_PAGE_N" ] do # Nun schreiben wir das ganze in eine Datei der Form eval temp='$FREIFUNK_GUI_PAGE_'$idx eval temp2='$FREIFUNK_GUI_PAGE_'$idx'_FILE' eval temp3='$FREIFUNK_GUI_PAGE_'$idx'_ORDER' eval temp4='$FREIFUNK_GUI_PAGE_'$idx'_TARGET' # get the file from the internet if [ -n "$FREIFUNK_GUI_PAGE_DLURL" ] then wget -q -O $FREIFUNK_GUI_PAGE_LOCAL/custom/$temp2.tmp - $FREIFUNK_GUI_PAGE_DLURL/$temp2.txt if [ -f $FREIFUNK_GUI_PAGE_LOCAL/custom/$temp2.tmp ] #file is present? then cp $FREIFUNK_GUI_PAGE_LOCAL/custom/$temp2.tmp /srv/www2/$temp2 # make it executable if it is a cgi script. chmod 755 /srv/www2/$temp2 echo "