add webif
[openwrt/svn-archive/archive.git] / openwrt / package / webif / files / www / cgi-bin / webif / system.sh
1 #!/usr/bin/haserl
2 <?
3 . /usr/lib/webif/webif.sh
4 load_settings system
5 load_settings nvram
6
7 [ -z $FORM_submit ] && {
8 FORM_hostname=${wan_hostname:-$(nvram get wan_hostname)}
9 FORM_hostname=${FORM_hostname:-OpenWrt}
10 grep BCM947 /proc/cpuinfo 2>&- >&- && {
11 FORM_boot_wait=${boot_wait:-$(nvram get boot_wait)}
12 FORM_boot_wait=${FORM_boot_wait:-off}
13 }
14 } || {
15 SAVED=1
16 [ -z $FORM_hostname ] || save_setting system wan_hostname $FORM_hostname
17 grep BCM947 /proc/cpuinfo 2>&- >&- && {
18 [ -z $FORM_boot_wait ] || save_setting nvram boot_wait $FORM_boot_wait
19 }
20 }
21 header "System" "Settings" "System settings"
22 ?>
23 <?if [ "$SAVED" = "1" ] ?>
24 <h2>Settings saved</h2>
25 <?el?>
26 <?
27 grep BCM947 /proc/cpuinfo 2>&- >&- && bootwait_form="field:boot_wait
28 radio:boot_wait:$FORM_boot_wait:on:On<br />
29 radio:boot_wait:$FORM_boot_wait:off:Off"
30
31 display_form "start_form:$SCRIPT_NAME
32 field:Hostname
33 text:hostname:$FORM_hostname
34 $bootwait_form
35 field
36 submit:action:Save settings
37 end_form"
38 ?>
39 <?fi?>
40
41 <? footer ?>
42 <!--
43 ##WEBIF:name:System:1:Settings
44 -->