Changeset 388

Show
Ignore:
Timestamp:
10/19/07 16:55:10 (1 year ago)
Author:
florida
Message:

Ajout mise a jour webif revision 3635

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • firmware/trunk/kamikaze/package/webif/Makefile

    r387 r388  
    33PKG_NAME:=webif 
    44PKG_VERSION:=0.3 
    5 PKG_RELEASE:=6 
     5PKG_RELEASE:=8 
    66 
    77PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) 
     
    1717  DEPENDS:=+haserl 
    1818  TITLE:=An HTTP administrative console for OpenWrt. 
    19   DESCRIPTION:=\ 
    20         This package contains Webif^2, a web based administration console for OpenWrt. 
    2119  VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) 
    2220endef 
     
    174172                rm -f $(1)/usr/lib/webif/fixed-functions.sh; \ 
    175173        fi 
    176         ./embed_rev.sh $(1)/www/.version \ 
    177                         $(1)/usr/lib/webif/webif.sh \ 
    178                         $(1)/etc/init.d/* \ 
    179                         $(1)/www/cgi-bin/webif/* 
    180         chmod 777 $(1)/CONTROL/*inst 
    181         ./embed_rev.sh $(1)/CONTROL/*inst 
    182         chmod 755 $(1)/CONTROL/*inst 
     174        ./embed_rev.sh $(1) 
    183175        mkdir -p $(1)/usr/bin 
    184176        $(INSTALL_BIN) $(PKG_BUILD_DIR)/webifmetabin $(1)/usr/bin/webifmetabin 
  • firmware/trunk/kamikaze/package/webif/embed_rev.sh

    r354 r388  
    11#!/bin/sh 
    22# 
    3 # this script embeds the global revision number in document(s) given on command line 
    4 # document should have __SVN_REVISION__ where it wants the revision number 
    5 # to be placed. Wildcards okay. 
     3# this script embeds the global revision number in document(s) given  
     4# on command line 
     5# document should have __SVN_REVISION__ where it wants the revision  
     6# number to be placed. Wildcards okay. 
    67# 
    78if [ $# -lt 1 ]; then 
     
    1011fi 
    1112revision_number=$(svn info | grep Revision | cut -c11-) 
    12 tempfile=$(mktemp) 
    1313echo " Revision number is $revision_number" 
    14 echo " Temporary file is $tempfile" 
    1514until [ -z "$1" ]   
    1615do 
    17         for curfile in $1; do 
     16        for curfile in $(grep -H "__SVN_REVISION__" -r "$1" | cut -d':' -f1 | sed '/\.svn\//d'); do 
    1817                echo " Processing $curfile ..." 
    19                 cp $curfile $tempfile    
    20                 cat $tempfile | sed s/__SVN_REVISION__/$revision_number/ > $curfile 
    21                 rm $tempfile     
     18                sed -i -e "s/__SVN_REVISION__/$revision_number/" "$curfile" 
    2219        done 
    23   shift 
     20       shift 
    2421done 
    2522 
  • firmware/trunk/kamikaze/package/webif/files/usr/lib/webif/apply.sh

    r387 r388  
    1919                        timezone_cfg="$CONFIG_SECTION" 
    2020                ;; 
    21                 ntp_client
     21                ntp_client|ntpclient
    2222                        config_get hostname     $CONFIG_SECTION hostname 
    2323                        config_get port         $CONFIG_SECTION port 
     
    2525         
    2626                        [ "$DONE" = "1" ] && exit 0 
    27                         ps x | grep 'bin/[n]tpclient' >&- || { 
     27                        ps | grep 'bin/[n]tpclient' >&- || { 
    2828                                route -n 2>&- | grep '^0.0.0.0' >&- && { 
    2929                                        /usr/sbin/ntpclient -c ${count:-1} -s -h $hostname -p ${port:-123} 2>&- >&- && DONE=1 
     
    6565# leave if some files not applied 
    6666rm -r "/tmp/.webif/edited-files" 2>&- 
     67 
     68 
     69config_allclear() { 
     70        for var in $(set | grep "^CONFIG_" | sed -e 's/\(.*\)=.*$/\1/'); do 
     71                unset "$var" 
     72        done 
     73} 
     74 
     75reload_upnpd() { 
     76        config_load upnpd 
     77        config_get_bool test config enabled 0 
     78        if [ 1 -eq "$test" ]; then 
     79                echo '@TR<<Starting>> @TR<<upnpd>> ...' 
     80                [ -f /etc/init.d/miniupnpd ] && { 
     81                        /etc/init.d/miniupnpd enable >&- 2>&- <&- 
     82                        /etc/init.d/miniupnpd start >&- 2>&- <&- 
     83                } 
     84                [ -f /etc/init.d/upnpd ] && { 
     85                        /etc/init.d/upnpd enable >&- 2>&- <&- 
     86                        /etc/init.d/upnpd restart >&- 2>&- <&- 
     87                } 
     88        else 
     89                echo '@TR<<Stopping>> @TR<<upnpd>> ...' 
     90                [ -f /etc/init.d/miniupnpd ] && { 
     91                        /etc/init.d/miniupnpd stop >&- 2>&- <&- 
     92                        /etc/init.d/miniupnpd disable >&- 2>&- <&- 
     93                } 
     94                [ -f /etc/init.d/upnpd ] && { 
     95                        /etc/init.d/upnpd stop >&- 2>&- <&- 
     96                        /etc/init.d/upnpd disable >&- 2>&- <&- 
     97                } 
     98        fi 
     99        config_allclear 
     100} 
     101 
    67102 
    68103# file-*                other config files 
     
    93128done 
    94129 
     130# clear all uci settings to free memory 
    95131# init_theme - initialize a new theme 
    96132init_theme() { 
    97         echo '@TR<<Initializing theme ...>>'     
    98         uci_load "webif" 
    99         newtheme="$CONFIG_theme_id"      
     133        echo '@TR<<Initializing theme ...>>' 
     134        config_get newtheme theme id 
    100135        # if theme isn't present, then install it                
    101136        ! exists "/www/themes/$newtheme/webif.css" && { 
     
    116151} 
    117152 
    118 reload_upnpd() { 
    119         config_load upnpd 
    120         config_get_bool test config enabled 0 
    121         if [ 1 -eq "$test" ]; then 
    122                 echo '@TR<<Starting>> @TR<<upnpd>> ...' 
    123                 [ -f /etc/init.d/miniupnpd ] && { 
    124                         /etc/init.d/miniupnpd enable >&- 2>&- <&- 
    125                         /etc/init.d/miniupnpd start >&- 2>&- <&- 
    126                 } 
    127                 [ -f /etc/init.d/upnpd ] && { 
    128                         /etc/init.d/upnpd enable >&- 2>&- <&- 
    129                         /etc/init.d/upnpd restart >&- 2>&- <&- 
    130                 } 
    131         else 
    132                 echo '@TR<<Stopping>> @TR<<upnpd>> ...' 
    133                 [ -f /etc/init.d/miniupnpd ] && { 
    134                         /etc/init.d/miniupnpd stop >&- 2>&- <&- 
    135                         /etc/init.d/miniupnpd disable >&- 2>&- <&- 
    136                 } 
    137                 [ -f /etc/init.d/upnpd ] && { 
    138                         /etc/init.d/upnpd stop >&- 2>&- <&- 
    139                         /etc/init.d/upnpd disable >&- 2>&- <&- 
    140                 } 
    141         fi 
    142         config_clear config 
    143 } 
    144  
    145153# switch_language (old_lang)  - switches language if changed 
    146154switch_language() { 
    147155        oldlang="$1" 
    148         uci_load "webif" 
    149         newlang="$CONFIG_general_lang" 
     156        config_get newlang general lang 
    150157        ! equal "$newlang" "$oldlang" && { 
    151158                echo '@TR<<Applying>> @TR<<Installing language pack>> ...' 
     
    167174} 
    168175 
    169 uci_load_originals() { 
    170         local cfsection 
    171         config_load "$1" 
    172         for cfsection in $CONFIG_SECTIONS; do 
    173                 config_rename "$cfsection" "orig_$cfsection" 
    174         done 
    175         CONFIG_orig_SECTION="$CONFIG_SECTIONS" 
    176 
    177  
    178 uci_unset_originals() { 
    179         local cfsection 
    180         local oldvar 
    181         for cfsection in $CONFIG_orig_SECTION; do 
    182                 for oldvar in $(set | grep "^CONFIG_${cfsection}_" | sed -e 's/\(.*\)=.*$/\1/'); do 
    183                        unset "$oldvar" 
    184                done 
    185         done 
    186         unset CONFIG_orig_SECTION 
    187 
     176reload_qos() { 
     177        config_load qos 
     178        config_get_bool wan_enabled wan enabled 0 
     179        if [ 1 -eq "$wan_enabled" ]; then 
     180                echo '@TR<<Starting>> @TR<<qos>> ...' 
     181               [ -f /etc/init.d/qos ] && { 
     182                       /etc/init.d/qos enable >&- 2>&- <&- 
     183                        /etc/init.d/qos start >&- 2>&- <&- 
     184                } 
     185        else 
     186               echo '@TR<<Stopping>> @TR<<qos>> ...' 
     187               [ -f /etc/init.d/qos ] && { 
     188                       /etc/init.d/qos stop >&- 2>&- <&- 
     189                       /etc/init.d/qos disable >&- 2>&- <&- 
     190                } 
     191        fi 
     192        config_allclear 
     193
     194 
    188195 
    189196# config-*              simple config files 
     
    202209# now apply any UCI config changes 
    203210# 
     211process_packages="" 
    204212for ucifile in $(ls /tmp/.uci/* 2>&-); do 
    205213        # do not process lock files 
    206214        [ "${ucifile%.lock}" != "${ucifile}" ] && continue 
    207         # store original language before committing new one so we know if changed 
    208         equal "$ucifile" "/tmp/.uci/webif" && { 
    209                 uci_load_originals "webif" 
    210                 oldlang="$CONFIG_orig_general_lang" 
    211                 uci_unset_originals "webif" 
    212                 uci_load "webif" 
    213         } 
     215 
    214216        package=${ucifile#/tmp/.uci/} 
     217        process_packages="$process_packages $package" 
     218 
     219        # get old/updated values for the package here 
     220        case "$ucifile" in 
     221                "/tmp/.uci/webif")  
     222                        config_load "/etc/config/$package" 
     223                        config_get apply_webif_oldlang general lang 
     224                        ;; 
     225        esac 
     226        config_allclear 
     227 
     228        # commit settings 
    215229        echo "@TR<<Committing>> $package ..." 
    216230        uci_commit "$package" 
    217         case "$ucifile" in 
    218                 "/tmp/.uci/qos") qos-start;; 
    219                 "/tmp/.uci/webif")  
    220                         switch_language "$oldlang" 
     231done 
     232 
     233[ -n "$process_packages" ] && echo "@TR<<Waiting for the commit to finish>>..." 
     234LOCK=`which lock` || LOCK=: 
     235for ucilock in $(ls /tmp/.uci/*.lock 2>&-); do 
     236        $LOCK -w "$ucilock" 
     237        rm "$ucilock" >&- 2>&- 
     238done 
     239 
     240# now process changes in UCI configs 
     241for package in $process_packages; do 
     242        # process settings 
     243        case "$package" in 
     244                "qos") 
     245                        reload_qos 
     246                        ;; 
     247                "webif") 
     248                        config_load webif 
     249                        switch_language "$apply_webif_oldlang" 
    221250                        init_theme 
    222251                        /etc/init.d/webif start 
    223                         ;; 
    224                 "/tmp/.uci/upnpd") 
     252                        config_allclear 
     253                        ;; 
     254                "upnpd") 
    225255                        reload_upnpd 
    226256                        ;; 
    227                 "/tmp/.uci/network") 
     257                "network") 
    228258                        echo '@TR<<Reloading>> @TR<<network>> ...' 
    229259                        /etc/init.d/network restart 
     
    233263                        fi 
    234264                        ;; 
    235                 "/tmp/.uci/ntp_client") 
     265                "ntp_client") 
     266                        #this is for 7.07 and previous 
    236267                        killall ntpclient 
    237268                        config_load ntp_client& 
    238269                        ;; 
    239                 "/tmp/.uci/dhcp") 
     270                "ntpclient") 
     271                        killall ntpclient 
     272                        config_load ntpclient& 
     273                        ;; 
     274                "dhcp") 
    240275                        killall dnsmasq 
    241276                        [ -z "$(ps | grep "[d]nsmasq ")" ] && /etc/init.d/dnsmasq start 
    242277                        ;; 
    243                 "/tmp/.uci/wireless") 
     278                "wireless") 
    244279                        echo '@TR<<Reloading>> @TR<<wireless>> ...' 
    245280                        wifi ;; 
    246                 "/tmp/.uci/syslog") 
     281                "syslog") 
    247282                        echo '@TR<<Reloading>> @TR<<syslogd>> ...' 
    248283                        /etc/init.d/syslog restart >&- 2>&- ;; 
    249                 "/tmp/.uci/openvpn") 
     284                "openvpn") 
    250285                        echo '@TR<<Reloading>> @TR<<OpenVPN>> ...' 
    251286                        killall openvpn >&- 2>&- <&- 
    252                         /etc/init.d/openvpn start ;; 
    253                 "/tmp/.uci/system") 
     287                        uci_load "openvpn" 
     288                        if [ "$CONFIG_general_mode" = "client" ]; then 
     289                                /etc/init.d/webifopenvpn enable 
     290                        else 
     291                                /etc/init.d/webifopenvpn disable 
     292                        fi 
     293                        /etc/init.d/webifopenvpn start ;; 
     294                "system") 
    254295                        config_load system ;; 
    255                 "/tmp/.uci/snmp") 
     296                "snmp") 
    256297                        echo '@TR<<Exporting>> @TR<<snmp settings>> ...' 
    257298                        [ -e "/sbin/save_snmp" ] && { 
     
    265306                        /etc/init.d/S??snmpd restart >&- 2>&- 
    266307                        ;; 
    267                 "/tmp/.uci/l2tpns") 
     308                "l2tpns") 
    268309                        echo '@TR<<Exporting>> @TR<<l2tpns server settings>> ...' 
    269310                        [ -e "/usr/lib/webif/l2tpns_apply.sh" ] && { 
     
    274315                        /etc/init.d/l2tpns restart >&- 2>&- 
    275316                        ;; 
    276                 "/tmp/.uci/updatedd") 
     317                "updatedd") 
    277318                        uci_load "updatedd" 
    278319                        if [ "$CONFIG_ddns_update" = "1" ]; then 
     
    284325                                /etc/init.d/ddns stop >&- 2>&- <&- 
    285326                        fi 
     327                        config_allclear 
    286328                        ;; 
    287                 "/tmp/.uci/timezone") 
     329                "timezone") 
    288330                        echo '@TR<<Exporting>> @TR<<TZ setting>> ...' 
    289331                        [ ! -f /etc/rc.d/S??timezone ] && /etc/init.d/timezone enable >&- 2>&- <&- 
    290332                        /etc/init.d/timezone restart 
    291333                        ;; 
    292                 "/tmp/.uci/webifssl") 
     334                "webifssl") 
    293335                        config_load webifssl 
    294336                        config_get_bool test matrixtunnel enable 0 
     
    306348                                } 
    307349                        fi 
     350                        config_allclear 
    308351                        ;; 
    309352        esac 
  • firmware/trunk/kamikaze/package/webif/files/usr/lib/webif/browser.awk

    r354 r388  
    4747                gsub(/^\/\//, "/", fullpath) 
    4848                print "<td class=\"leftimage\"><a href=\"" url "?path=" fullpath "\"><img src=\"/images/dir.gif\" alt=\"@TR<<browser_Parent_Directory#Parent Directory>>\" /></a></td>" 
    49                 print "<td><a href=\"" url "?path=" fullpath "\">@TR<<browser_Parent_Directory#Parent Directory>></a>
     49                print "<td><a href=\"" url "?path=" fullpath "\">@TR<<browser_Parent_Directory#Parent Directory>></a></td>
    5050                print "<td>&nbsp;</td>" 
    5151                print "<td>&nbsp;</td>" 
  • firmware/trunk/kamikaze/package/webif/files/usr/lib/webif/common.awk

    r387 r388  
    3333function config_get_bool(package, option, default, var) { 
    3434        var = config_get(package, option); 
    35         if ((var == "enabled") || (var == "1") || (var == "on")) return 1 
    36         if ((var == "disabled") || (var == "0") || (var == "off")) return 0 
     35        if ((var == "1") || (var == "on") || (var == "true") || (var == "enabled")) return 1 
     36        if ((var == "0") || (var == "off") || (var == "false") || (var == "disabled")) return 0 
    3737        return (default == "1" ? 1 : 0) 
    3838} 
     
    118118        # parse all ##WEBIF... 
    119119        n = 0 
    120         while (("grep '^##WEBIF:' /www/cgi-bin/webif/*.awx /www/cgi-bin/webif/*.sh 2>/dev/null | sed 's,^[^:]*\/,,; s/##WEBIF:name://; s/^\\([^:]*\\):\\(.*\\)/\\2:\\1/' | sort" | getline) == 1) { 
     120        while (("grep '^##WEBIF:' "cgidir"/*.awx "cgidir"/*.sh 2>/dev/null | sed 's,^[^:]*\/,,; s/##WEBIF:name://; s/^\\([^:]*\\):\\(.*\\)/\\2:\\1/' | sort" | getline) == 1) { 
    121121                if ((mainmenu[$1 SUBSEP "url"] == "")  && ($4 != "")) mainmenu[$1 SUBSEP "url"] = rootdir "/" $4 
    122122                if (mainmenu[$1 SUBSEP "pages"] !~ /:$2:/) { 
     
    133133        } 
    134134        # parse extra subcategories 
    135         while (("/bin/ash -c '. /www/cgi-bin/webif/graphs-subcategories.sh; subcategories_extra' | sed 's/##WEBIF:name://' | sort" | getline) == 1) { 
     135        while (("/bin/ash -c '. "cgidir"/graphs-subcategories.sh; subcategories_extra' | sed 's/##WEBIF:name://' | sort" | getline) == 1) { 
    136136                if ((mainmenu[$1 SUBSEP "url"] == "")  && ($4 != "")) mainmenu[$1 SUBSEP "url"] = rootdir "/" $4 
    137137                mainmenu[$1 SUBSEP "count"]++ 
     
    245245# parameters: 0 
    246246function status(hostname, uptime, loadavg, i) { 
    247         if (config_get("general", "use_short_status_frame") == "1") { 
    248                 return "<iframe src=\"/cgi-bin/webif/iframe.mini-info.sh\" width=\"200\" height=\"80\" scrolling=\"no\" frameborder=\"0\"></iframe>" 
    249         } 
    250          
    251247        getline < "/proc/sys/kernel/hostname" 
    252248        hostname=$0 
  • firmware/trunk/kamikaze/package/webif/files/usr/lib/webif/functions.sh

    r354 r388  
    175175                pcnt=$((pcnt + 1)) 
    176176                empty $(ipkg list_installed | grep "^$pkg ") && { 
    177                         echo -n "<p>@TR<<features_require_package#Features on this page require the package>>: \"<b>$pkg</b>\". &nbsp;<a href=\"/cgi-bin/webif/ipkg.sh?action=install&amp;pkg=$pkg&amp;prev=$SCRIPT_NAME\">@TR<<features_install#install now>></a>.</p>" 
     177                        echo -n "<p>@TR<<features_require_package#Features on this page require the package>>: \"<b>$pkg</b>\". &nbsp;<a href=\"/cgi-bin/webif/system-ipkg.sh?action=install&amp;pkg=$pkg&amp;prev=$SCRIPT_NAME\">@TR<<features_install#install now>></a>.</p>" 
    178178                        retval=1; 
    179179                        nothave=$((nothave + 1)) 
  • firmware/trunk/kamikaze/package/webif/files/usr/lib/webif/timezones.csv

    r387 r388  
    11#timezone group timezone cities timezone config string  zoneinfo 
    2 #revision: 2007f 
     2#revision: 2007h 
    33#  it is not exact for the "cities list" but it enables to remember  
    44#  the selection and to synchronize TZs with the standard zoneinfo 
    5 Australia       Melbourne,Canberra,Sydney       EST-10EST,M10.5.0,M3.5.0/3    Australia/Melbourne 
    6 Australia       Perth   WST-8   Australia/Perth        Perth 
     5Australia       Melbourne,Canberra,Sydney       EST-10EST,M10.1.0,M4.1.0/3    Australia/Melbourne 
     6Australia       Perth   WST-8   Australia/Perth 
    77Australia       Brisbane        EST-10  Australia/Brisbane 
    8 Australia       Adelaide        CST-9:30CST,M10.5.0,M3.5.0/3  Australia/Adelaide 
     8Australia       Adelaide        CST-9:30CST,M10.1.0,M4.1.0/3  Australia/Adelaide 
    99Australia       Darwin  CST-9:30        Australia/Darwin 
    10 Australia       Hobart  EST-10EST,M10.1.0,M3.5.0/3    Australia/Hobart 
     10Australia       Hobart  EST-10EST,M10.1.0,M4.1.0/3    Australia/Hobart 
    1111 
    1212Europe  Amsterdam,Netherlands   CET-1CEST,M3.5.0,M10.5.0/3      Europe/Amsterdam 
     
    3131Europe  Zurich,Switzerland      CET-1CEST,M3.5.0,M10.5.0/3      Europe/Zurich 
    3232 
    33 New Zealand     Auckland, Wellington    NZST-12NZDT,M10.1.0,M3.3.0/3  Pacific/Auckland 
     33New Zealand     Auckland, Wellington    NZST-12NZDT,M9.5.0,M4.1.0/3   Pacific/Auckland 
    3434 
    3535USA &amp; Canada        Hawaii Time     HST10   Pacific/Honolulu 
     
    4747Asia (UTC+2)    Amman   EET-2EEST,M3.5.4/0,M10.5.5/1    Asia/Amman 
    4848Asia (UTC+2)    Beirut  EET-2EEST,M3.5.0/0,M10.5.0/0    Asia/Beirut 
    49 Asia (UTC+2)    Damascus        EET-2EEST,J91/0,J274/0        Asia/Damascus 
    50 Asia (UTC+2)    Gaza    EET-2EEST,J91/0,M10.3.5/0     Asia/Gaza 
     49Asia (UTC+2)    Damascus        EET-2EEST,M3.5.5/0,J274/0     Asia/Damascus 
     50Asia (UTC+2)    Gaza    EET-2EEST,J91/0,M9.2.4        Asia/Gaza 
    5151Asia (UTC+2)    Jerusalem       GMT-2   Asia/Jerusalem 
    5252Asia (UTC+2)    Nicosia EET-2EEST,M3.5.0/3,M10.5.0/4    Asia/Nicosia 
     
    109109Asia (UTC+9)    Yakutsk YAKT-9YAKST,M3.5.0,M10.5.0/3    Asia/Yakutsk 
    110110 
    111 Central and South America       Sao Paulo,Brazil        BRT3BRST,M11.1.0/0,M2.5.0/0   America/Sao_Paulo 
     111Central and South America       Sao Paulo,Brazil        BRT3BRST,M10.2.0/0,M2.3.0/0   America/Sao_Paulo 
    112112Central and South America       Argentina       ART3    America/Argentina/Buenos_Aires 
    113113# no offense, just something in the center 
  • firmware/trunk/kamikaze/package/webif/files/usr/lib/webif/webif.sh

    r387 r388  
    7474                pcnt=$((pcnt + 1)) 
    7575                empty $(ipkg list_installed | grep "^$pkg ") && { 
    76                         echo -n "<p>@TR<<features_require_package#Features on this page require the package>>: \"<b>$pkg</b>\". &nbsp;<a href=\"/cgi-bin/webif/ipkg.sh?action=install&amp;pkg=$pkg&amp;prev=$SCRIPT_NAME\">@TR<<features_install#install now>></a>.</p>" 
     76                        echo -n "<p>@TR<<features_require_package#Features on this page require the package>>: \"<b>$pkg</b>\". &nbsp;<a href=\"/cgi-bin/webif/system-ipkg.sh?action=install&amp;pkg=$pkg&amp;prev=$SCRIPT_NAME\">@TR<<features_install#install now>></a>.</p>" 
    7777                        retval=1; 
    7878                        nothave=$((nothave + 1)) 
  • firmware/trunk/kamikaze/package/webif/files/www/cgi-bin/webif/config.sh

    r387 r388  
    99esac 
    1010case "$FORM_mode" in 
    11         nochange) header "$FORM_cat" . "@TR<<No config change.|No configuration changes were made.>>";; 
     11        nochange) header "$FORM_cat" "" "@TR<<No config change.|No configuration changes were made.>>";; 
    1212        clear) 
    1313                rm -r /tmp/.webif/* >&- 2>&- 
    14                 rm /tmp/.uci/* >&- 2>&-  
    15                 header "$FORM_cat" . "@TR<<Config discarded.|Your configuration changes have been discarded.>>" 
     14                rm /tmp/.uci/* >&- 2>&- 
     15                header "$FORM_cat" "" "@TR<<Config discarded.|Your configuration changes have been discarded.>>" 
    1616                CHANGES="" 
    1717                echo "${FORM_prev:+<meta http-equiv=\"refresh\" content=\"2; URL=$FORM_prev\" />}" 
    1818                ;; 
    1919        review) 
    20                 header "$FORM_cat" . "@TR<<Config changes:|Current configuration changes:>>"            
     20                header "$FORM_cat" "" "@TR<<Config changes:|Current configuration changes:>>" 
    2121                for configname in $(ls /tmp/.webif/config-* 2>&-); do 
    2222                        grep = $configname >&- 2>&- && { 
     
    2525                                echo '</pre><br />' 
    2626                        } 
    27                 done    
     27                done 
    2828                CONFIGFILES="" 
    2929                for configname in $(ls /tmp/.webif/file-* 2>&-); do 
    3030                        exists "$configname" && { 
    31                                 configname=$(echo $configname | sed s/'\/tmp\/.webif\/'//g)  
     31                                configname=$(echo $configname | sed s/'\/tmp\/.webif\/'//g) 
    3232                                CONFIGFILES="$CONFIGFILES ${configname#/tmp/.webif/file-}" 
    3333                        } 
    34                 done            
     34                done 
    3535                for configname in $(ls /tmp/.uci/* 2>&- | grep -v "\\.lock\$" 2>&-); do 
    3636                                echo -n "<h3>${configname#/tmp/.uci/}</h3><br /><pre>" 
     
    5151                ;; 
    5252        save) 
    53                 header "$FORM_cat" . "@TR<<Updating config...|Updating your configuration...>>" 
     53                header "$FORM_cat" "" "@TR<<Updating config...|Updating your configuration...>>" 
    5454                CHANGES="" 
    5555                echo "<pre>" 
  • firmware/trunk/kamikaze/package/webif/files/www/cgi-bin/webif/network-ddns.sh

    r387 r388  
    2121 
    2222header "Network" "DynDNS" "@TR<<DynDNS Settings>>" 'onload="modechange()"' "$SCRIPT_NAME" 
     23 
     24uci_load "webif" 
     25config_get revision general firmware_version 
     26if [ "$revision" = "7.07" ]; then 
     27        username="user" 
     28        password="passwd" 
     29else 
     30        username="username" 
     31        password="password" 
     32fi 
    2333 
    2434#define supported services 
     
    5464        uci_load "updatedd" 
    5565        config_get FORM_ddns_service cfg1 ddns_service  
    56         config_get FORM_ddns_user    cfg1 ddns_user 
    57         config_get FORM_ddns_passwd  cfg1 ddns_passw
     66        config_get FORM_ddns_user    cfg1 ddns_$username 
     67        config_get FORM_ddns_passwd  cfg1 ddns_$passwor
    5868        config_get FORM_ddns_host    cfg1 ddns_host 
    5969        config_get FORM_ddns_update  cfg1 ddns_update 
     
    7181                uci_set "updatedd" "cfg1" "ddns_update" "$FORM_ddns_update" 
    7282                uci_set "updatedd" "cfg1" "ddns_service" "$FORM_ddns_service" 
    73                 uci_set "updatedd" "cfg1" "ddns_user" "$FORM_ddns_user" 
    74                 uci_set "updatedd" "cfg1" "ddns_passwd" "$FORM_ddns_passwd" 
     83                uci_set "updatedd" "cfg1" "ddns_$username" "$FORM_ddns_user" 
     84                uci_set "updatedd" "cfg1" "ddns_$password" "$FORM_ddns_passwd" 
    7585                uci_set "updatedd" "cfg1" "ddns_host" "$FORM_ddns_host" 
    7686        } 
  • firmware/trunk/kamikaze/package/webif/files/www/cgi-bin/webif/network-firewall.sh

    r354 r388  
    3939} 
    4040 
     41config_load "network" 
     42config_load "/var/state/network" 
     43config_get default_lan_target lan ipaddr 
     44default_lan_target="${default_lan_target:-192.168.1.1}" 
     45 
    4146empty "$FORM_up$FORM_down$FORM_save$FORM_delete$FORM_new" || { 
    4247        empty "$FORM_up" || equal "$FORM_up" 1 || { 
     
    5964                -v new="$FORM_new" \ 
    6065                -v new_target="$FORM_new_target" \ 
     66                -v default_lan_target="$default_lan_target" \ 
    6167                -f - "$FW_FILE" > "$FW_FILE_NEW" <<EOF 
    6268BEGIN { 
     
    120126END { 
    121127        if (line_down != "") print line_down 
    122         if (new_target == "forward") new_target = new_target "::192.168.1.1" 
     128        if (new_target == "forward") new_target = new_target "::" default_lan_target 
    123129        if ((new != "") && (new_target != "")) print new_target 
    124130} 
     
    129135} 
    130136 
    131 header "Network" "Firewall" "@TR<<Firewall Configuration>>" '' 
    132  
    133 ?> 
    134 <style> 
     137header_inject_head=$(cat <<EOF 
     138<style type="text/css"> 
     139<!-- 
    135140td.edit_title { 
    136141        font-weight: bold; 
     
    147152        padding-bottom: auto; 
    148153} 
     154--> 
    149155</style> 
    150 <? 
     156 
     157EOF 
     158
     159 
     160header "Network" "Firewall" "@TR<<Firewall Configuration>>" '' 
    151161 
    152162awk \ 
  • firmware/trunk/kamikaze/package/webif/files/www/cgi-bin/webif/network-wakeonlan.sh

    r354 r388  
    6161 
    6262if [ -e /etc/ethers ]; then 
    63         cat $ETHERS_FILE | awk -F ' '
     63        cat $ETHERS_FILE | awk
    6464        { 
    65                 "grep -e "$2" /etc/hosts | sed \"s/^"$2"\w*//\"" | getline hostname; 
    66                 print "<tr><td>" hostname "</td><td>" $2 "</td><td>" $1 "</td><td><button name=\"wake\" type=\"submit\" value=\"" $1 "\">Wake up</button></td></tr>"; 
     65                if ($1 ~ /^[[:xdigit:]]{2,2}:[[:xdigit:]]{2,2}:[[:xdigit:]]{2,2}:[[:xdigit:]]{2,2}:[[:xdigit:]]{2,2}:[[:xdigit:]]{2,2}/) { 
     66                        "grep -e "$2" /etc/hosts | sed \"s/^"$2"\w*//\"" | getline hostname; 
     67                        print "<tr><td>" hostname "</td><td>" $2 "</td><td>" $1 "</td><td><button name=\"wake\" type=\"submit\" value=\"" $1 "\">Wake up</button></td></tr>" 
     68                } 
    6769        }' 
    6870fi 
  • firmware/trunk/kamikaze/package/webif/files/www/cgi-bin/webif/network-wlan.sh

    r387 r388  
    304304                                config_get FORM_mode $vcfg mode 
    305305                                config_get FORM_ssid $vcfg ssid 
     306                                config_get FORM_bssid $vcfg bssid 
    306307                                config_get FORM_encryption $vcfg encryption 
    307308                                config_get FORM_key $vcfg key 
     
    322323                                config_get_bool FORM_isolate $vcfg isolate 
    323324                                config_get_bool FORM_bgscan $vcfg bgscan 
     325                                config_get_bool FORM_wds $vcfg wds 
    324326                        else 
    325327                                eval FORM_key="\$FORM_radius_key_$vcfg" 
     
    343345                                eval FORM_broadcast="\$FORM_broadcast_$vcfg" 
    344346                                eval FORM_ssid="\$FORM_ssid_$vcfg" 
     347                                eval FORM_wds="\$FORM_wds_$vcfg" 
     348                                eval FORM_bssid="\$FORM_bssid_$vcfg" 
    345349                                eval FORM_network="\$FORM_network_$vcfg" 
    346350                                eval FORM_txpower="\$FORM_txpower_$vcfg" 
    347351                                eval FORM_bgscan="\$FORM_bgscan_$vcfg" 
    348                                 eval FORM_isolate="\$FORM_isolate_$vcfg" 
    349352                                eval FORM_frag="\$FORM_frag_$vcfg" 
    350353                                eval FORM_rts="\$FORM_rts_$vcfg" 
     
    362365                                $network_options" 
    363366                        append forms "$network" "$N" 
     367                         
     368                        if [ "$iftype" != "mac80211" ]; then 
     369                                option_wds="option|wds|@TR<<WDS>>" 
     370                                append forms "helpitem|WDS Connections" "$N" 
     371                                append forms "helptext|Helptext WDS Connections#Enter the MAC address of the router on your network that should be wirelessly connected to. The other router must also support wds and have the mac address of this router entered." "$N" 
     372                        fi 
    364373 
    365374                        mode_fields="field|@TR<<WLAN Mode#Mode>> 
    366375                        select|mode_$vcfg|$FORM_mode 
    367376                        option|ap|@TR<<Access Point>> 
    368                         option|wds|@TR<<WDS>> 
     377                        $option_wds 
    369378                        option|sta|@TR<<Client>> 
    370379                        option|adhoc|@TR<<Ad-Hoc>>" 
    371380                        append forms "$mode_fields" "$N" 
    372                         append forms "helpitem|WDS Connections" "$N" 
    373                         append forms "helptext|Helptext WDS Connections#Enter the MAC address of the router on your network that should be wirelessly connected to. The other router must also support wds and have the mac address of this router entered." "$N" 
     381 
     382                        wds="field|@TR<<WDS>>|wds_form_$vcfg|hidden 
     383                                radio|wds_$vcfg|$FORM_wds|1|@TR<<On>> 
     384                                radio|wds_$vcfg|$FORM_wds|0|@TR<<Off>>" 
     385                        append forms "$wds" "$N" 
    374386 
    375387                        hidden="field|@TR<<ESSID Broadcast>>|broadcast_form_$vcfg|hidden 
     
    392404 
    393405                        if [ "$iftype" = "atheros" ]; then 
    394                         eval txpowers="\$CONFIG_wireless_${device}_txpower" 
    395                         [ -z "$txpowers" ] && { 
    396                                 txpower="" 
    397                                 for athname in $(ls /proc/sys/net/ 2>/dev/null | grep "^ath"); do 
    398                                         [ "$(cat /proc/sys/net/${athname}/\%parent)" = "$device" ] && { 
    399                                                 for power in $(iwlist $athname txpower 2>&1 | sed '/dBm/!d /Current/d; s/^[[:space:]]*//;' | cut -d ' ' -f 1); do 
     406                                eval txpowers="\$CONFIG_wireless_${device}_txpower" 
     407                                [ -z "$txpowers" ] && { 
     408                                        txpower="" 
     409                                        for athname in $(ls /proc/sys/net/ 2>/dev/null | grep "^ath"); do 
     410                                                [ "$(cat /proc/sys/net/${athname}/\%parent)" = "$device" ] && { 
     411                                                        for power in $(iwlist $athname txpower 2>&1 | sed '/dBm/!d /Current/d; s/^[[:space:]]*//;' | cut -d ' ' -f 1); do 
     412                                                                txpower="$txpower $power" 
     413                                                        done 
     414