fix typos in CONFIG_SITE files
[openwrt/svn-archive/openwrt.git] / openwrt / package / webif / files / www / cgi-bin / webif / config.sh
1 #!/usr/bin/webif-page
2 <?
3 . /usr/lib/webif/webif.sh
4
5 update_changes
6
7 case "$CHANGES" in
8 ""|0)FORM_mode=nochange
9 esac
10 case "$FORM_mode" in
11 nochange) header $FORM_cat . "@TR<<No config change.|No configuration changes were made.>>";;
12 clear)
13 rm -rf /tmp/.webif >&- 2>&-
14 header $FORM_cat . "@TR<<Config discarded.|Your configuration changes have been discarded.>>"
15 CHANGES=""
16 echo "${FORM_prev:+<meta http-equiv=\"refresh\" content=\"2; URL=$FORM_prev\" />}"
17 ;;
18 review)
19 header $FORM_cat . "@TR<<Config changes:|Current configuration changes:>>"
20 cd /tmp/.webif
21 for configname in config-*; do
22 grep = $configname >&- 2>&- && {
23 echo -n "<h3>${configname#config-}</h3><br /><pre>"
24 cat $configname
25 echo '</pre><br />'
26 }
27 done
28 CONFIGFILES=""
29 for configname in file-*; do
30 exists "$configname" && CONFIGFILES="$CONFIGFILES ${configname#file-}"
31 done
32 CONFIGFILES="${CONFIGFILES:+<h3 style="display:inline">Config files: </h3>$CONFIGFILES<br />}"
33 echo $CONFIGFILES
34 ;;
35 save)
36 header $FORM_cat . "@TR<<Updating config...|Updating your configuration...>>"
37 CHANGES=""
38 echo "<pre>"
39 sh /usr/lib/webif/apply.sh 2>&1
40 echo "</pre>${FORM_prev:+<meta http-equiv=\"refresh\" content=\"2; URL=$FORM_prev\" />}"
41 ;;
42 esac
43
44 footer
45
46 ?>