Changeset 104

Show
Ignore:
Timestamp:
04/27/07 22:43:22 (2 years ago)
Author:
Trellmor
Message:

Added: Fon Updates (Thanks denk_mal)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bin/thinclient

    r68 r104  
    3939WLMAC=$( ifconfig $wifi_ifname|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g" ) 
    4040WLMAC2=$( ifconfig $lan_ifname|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g" ) 
    41 ETMAC=$( ifconfig eth0|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g" ) 
     41if [ -f /tmp/eth0_mac ] 
     42then 
     43        ETMAC=$(cat /tmp/eth0_mac) 
     44else 
     45        ETMAC=$( ifconfig eth0|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g" ) 
     46fi 
    4247 
    4348# gather information about this machine 
     
    4853CHILLVER="1.0-1" 
    4954 
    50 MODE=$1 
     55record_changes () { 
     56        if [ ! -d /www/updates ]; then 
     57                mkdir /www/updates 
     58        fi 
     59        if [ -s /tmp/thinclient.sh ]; then 
     60                FS=$(ls -l /tmp/$1.sh | tr -s " " | cut -d " " -f 5) 
     61                if [ $FS -gt 35 ]; then 
     62                        cp /tmp/$1.sh /www/updates/$1-$(date '+%Y%m%d-%H%M').sh 
     63                fi 
     64        else 
     65                echo "Datei leer oder nicht da. $(date '+%Y%m%d-%H%M')" >> /www/updates/fonupdate.log; 
     66        fi 
     67
    5168 
    52 rm -f /tmp/.thinclient.sh 
     69exec_cron_mode () { 
     70        if [ "t"$2 != "t" ]; then 
     71                sleep "$((0x$(head -c2 /dev/urandom | hexdump | awk '$2 > 0 {print $2}') % $2))" 
     72        fi 
     73 
     74        echo "mode='$1' wlmac='$WLMAC' mac='$ETMAC' fonrev='$FONREV' firmware='$FIRMWARE' chillver='$CHILLVER' thclver='$THCLVER' device='$DEVICE'" | ssh -T ${PORT:+ -p $PORT}${KEY:+ -i $KEY} "${USER}@${SERVER}" > /tmp/thinclient.sh 
     75 
     76        record_changes 'thinclient' 
     77
     78 
     79rm -f /tmp/thinclient.sh 
    5380 
    5481case "$1" in 
    55     cron) 
    56                 sleep "$((0x$(head -c2 /dev/urandom | hexdump | awk '$2 > 0 {print $2}') % 3600))" 
    57                 echo "mode='$MODE' wlmac='$WLMAC' mac='$ETMAC' fonrev='$FONREV' firmware='$FIRMWARE' chillver='$CHILLVER' thclver='$THCLVER' device='$DEVICE'" | ssh -T ${PORT:+ -p $PORT}${KEY:+ -i $KEY} "${USER}@${SERVER}" > /tmp/.thinclient.sh 
     82        cron) 
     83                exec_cron_mode $1 '3600' 
    5884                ;; 
    59     start
    60                 echo "mode='$MODE' wlmac='$WLMAC' mac='$ETMAC' fonrev='$FONREV' firmware='$FIRMWARE' chillver='$CHILLVER' thclver='$THCLVER' device='$DEVICE'" | ssh -T ${PORT:+ -p $PORT}${KEY:+ -i $KEY} "${USER}@${SERVER}" > /tmp/.thinclient.sh 
     85       force
     86                exec_cron_mode 'cron' 
    6187                ;; 
    62     *) 
    63                 echo "Usage: `basename $0` {cron|start}" 
     88        start) 
     89                exec_cron_mode $1 
     90                ;; 
     91        *) 
     92                echo "Usage: `basename $0` {cron|force|start}" 
    6493                exit 
    6594esac 
  • trunk/usr/lib/webif/advanced.sh

    r100 r104  
    9595</tr> 
    9696<tr> 
    97         <td align=\"right\"><span class=\"submenu${sel_diag:+_sel}\"> 
    98                 <a href=\"/cgi-bin/webif/diag.sh\">@TR<<Diag>></a> 
     97        <td align=\"right\"><span class=\"submenu${sel_fonupdate:+_sel}\"> 
     98                <a href=\"/cgi-bin/webif/fonupdate.sh\">@TR<<Fon Updates>></a> 
    9999        </span></td> 
    100100</tr> 
     
    150150</tr> 
    151151<tr> 
    152         <td align=\"right\"><span class=\"submenu${sel_diag:+_sel}\"> 
    153                 <a href=\"/cgi-bin/webif/diag.sh\">@TR<<Diag>></a> 
     152        <td align=\"right\"><span class=\"submenu${sel_fonupdate:+_sel}\"> 
     153                <a href=\"/cgi-bin/webif/fonupdate.sh\">@TR<<Fon Updates>></a> 
    154154        </span></td> 
    155155</tr> 
  • trunk/usr/lib/webif/lang/de/fon.txt

    r64 r104  
    593593FonFan Status Picker => FonFan Status Picker 
    594594 
     595########################## 
     596#  ../webif/fonupdate.sh # 
     597########################## 
     598 
     599#Fon Updates 
     600Fon Updates => Fon Updates 
     601 
     602#regular FON Updates 
     603FON Update Title => regulÀre FON Updates 
     604 
     605#Here you can see relevant updates ejected by FON. 
     606FON Updates => Hier kannst Du die nicht standardisierten Updates von FON sehen. 
     607 
     608#show 
     609Show => Anzeigen 
     610 
     611#execute 
     612Execute => AusfÃŒhren 
     613 
     614#Content of the file: 
     615FON Content => Inhalt der Datei: 
     616 
     617#The script has been executed successfully. 
     618FON Execute success => Das Script wurde erfolgreich ausgefÃŒhrt. 
     619 
     620#The script has been deleted successfully. 
     621FON Delete success => Das Script wurde erfolgreich gelöscht. 
     622 
     623#Check for Updates... 
     624FON Check => PrÃŒfe auf Updates... 
     625 
    595626########################### 
    596627# ../webif/help/fonfan.sh #