Commit f5e5aeb7 authored by Gustavo Zacarias's avatar Gustavo Zacarias Committed by Peter Korsgaard
Browse files

webif: remove deprecated

parent 789a7cf4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -485,7 +485,6 @@ source "package/udpcast/Config.in"
source "package/vpnc/Config.in"
source "package/vsftpd/Config.in"
source "package/vtun/Config.in"
source "package/webif/Config.in"
if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
source "package/wget/Config.in"
endif

package/webif/Config.in

deleted100644 → 0
+0 −28
Original line number Diff line number Diff line
config BR2_PACKAGE_WEBIF
	bool "webif - Status Console"
	depends on BR2_PACKAGE_BUSYBOX # httpd
	depends on BR2_DEPRECATED
	select BR2_PACKAGE_HASERL
	help
	  A web interface for showing different network status. This package
	  requires awk support on the system, either the one provided by
	  Busybox or gawk.

	  The default login on the status web pages are root/root and
	  admin/admin. This can be changed in the etc/httpd.conf file.

config BR2_PACKAGE_WEBIF_INSTALL_INDEX_HTML
	bool "instal index.html in /www which redirects to webif"
	depends on BR2_PACKAGE_WEBIF
	help
	  Installs a /www/index.html which redirects to the status console cgi
	  scripts.

config BR2_PACKAGE_WEBIF_LANGUAGES
	bool "install language support"
	depends on BR2_PACKAGE_WEBIF
	help
	  This option installs support for other languages than english.

	  Supported languages: ca, cz, de, dk, ee, es, fr, hr, hu, it, nl, no,
	                       pl, pt, ru and se.
+0 −8
Original line number Diff line number Diff line
.asp:text/html
/cgi-bin/webif:root:root
/cgi-bin/webif:admin:admin
.svg:image/svg+xml
.png:image/png
.gif:image/gif
.jpg:image/jpg
+0 −76
Original line number Diff line number Diff line
#!/bin/ash
#
# Default handlers for config files
#
HANDLERS_config='
	wireless) reload_wireless;;
	network) reload_network;;
	system) reload_system;;
'
HANDLERS_file='
	hosts) rm -f /etc/hosts; mv $config /etc/hosts; killall -HUP dnsmasq ;;
	ethers) rm -f /etc/ethers; mv $config /etc/ethers; killall -HUP dnsmasq ;;
	firewall) mv /tmp/.webif/file-firewall /etc/config/firewall && /etc/init.d/S45firewall;;
'

# for some reason a for loop with "." doesn't work
eval "$(cat /usr/lib/webif/apply-*.sh 2>&-)"

reload_network() {
	echo '@TR<<Reloading>> @TR<<networking settings>> ...'
	grep '^wan_' config-network >&- 2>&- && {
		ifdown wan
		ifup wan
		killall -HUP dnsmasq
	}
	
	grep '^lan_' config-network >&- 2>&- && {
		ifdown lan
		ifup lan
		killall dnsmasq
		/etc/init.d/S??dnsmasq
	}
}

reload_wireless() {
	echo '@TR<<Reloading>> @TR<<wireless settings>> ...'
	killall nas >&- 2>&- && sleep 2
	(
		/sbin/wifi
		[ -f /etc/init.d/S41wpa ] && /etc/init.d/S41wpa
	) >&- 2>&- <&-
}

reload_system() {
	echo '@TR<<Applying>> @TR<<system settings>> ...'
	echo "$(nvram get wan_hostname)" > /proc/sys/kernel/hostname
}

cd /tmp/.webif

# file-* 		other config files
for config in $(ls file-* 2>&-); do
	name=${config#file-}
	echo "@TR<<Processing>> @TR<<config file>>: $name"
	eval 'case "$name" in
		'"$HANDLERS_file"'
	esac'
done

# config-*		simple config files
(
	cd /proc/self
	cat /tmp/.webif/config-* 2>&- | grep '=' >&- 2>&- && {
		cat /tmp/.webif/config-* 2>&- | tee fd/1 | xargs -n1 nvram set
		echo "@TR<<Committing>> NVRAM ..."
		nvram commit
	}
)
for config in $(ls config-* 2>&-); do 
	name=${config#config-}
	eval 'case "$name" in
		'"$HANDLERS_config"'
	esac'
done
sleep 2
rm -f config-*
+0 −27
Original line number Diff line number Diff line
BEGIN {
	n = 0
	sel = 0
	FS=":"
}
($3 == "category") && (categories !~ /:$4:/) {
	categories = categories ":" $4 ":";
 	n++
	if ($4 ~ "^" selected "$") sel = n
	c[n] = $4
	if (f[$4] == "") f[$4] = rootdir "/" indexpage "?cat=" $4
}
($3 == "name") && ((p[$4] == 0) || (p[$4] > int($5))) {
	gsub(/^.*\//, "", $1);
	p[$4] = int($5) + 1
	f[$4] = rootdir "/" $1
}
END {
	print "<div id=\"mainmenu\"><h3><strong>@TR<<Categories>>:</strong></h3><ul>"
	
	for (i = 1; i <= n; i++) {
		if (sel == i) print "<li class=\"selected-maincat\"><a href=\"" f[c[i]] "\">&raquo;@TR<<" c[i] ">>&laquo;</a></li>"
		else print "<li><a href=\"" f[c[i]] "\">&nbsp;@TR<<" c[i] ">>&nbsp;</a></li>";
	}
  
	print "</ul></div>"
}
Loading