tazpanel diff index.cgi @ rev 194

Add cat support in terminal and fix log file path
author Christophe Lincoln <pankso@slitaz.org>
date Fri Jun 10 22:29:16 2011 +0200 (2011-06-10)
parents d65aa88d638f
children 4a4d48fb6190
line diff
     1.1 --- a/index.cgi	Fri Jun 10 21:40:07 2011 +0200
     1.2 +++ b/index.cgi	Fri Jun 10 22:29:16 2011 +0200
     1.3 @@ -104,7 +104,7 @@
     1.4  		fi ;;
     1.5  	*\ terminal\ *|*\ cmd\ *)
     1.6  		# Cmdline terminal.
     1.7 -		commands='du help ls ping pwd who wget'
     1.8 +		commands='cat du help ls ping pwd who wget'
     1.9  		cmd=$(GET cmd)
    1.10  		TITLE="- $(gettext "Terminal")"
    1.11  		xhtml_header
    1.12 @@ -128,6 +128,12 @@
    1.13  			cd $dl && $cmd ;;
    1.14  		du*|ls*|ping*|pwd|who)
    1.15  			$cmd ;;
    1.16 +		cat*)
    1.17 +			# Cmd must be used with an arg.
    1.18 +			arg=$(echo $cmd | awk '{print $2}')
    1.19 +			[ "$arg" == "" ] && echo -n "$cmd " && \
    1.20 +				gettext "needs an arument $arg" && exit 0
    1.21 +			$cmd ;;
    1.22  		*)
    1.23  			[ "$cmd" == "" ] || \
    1.24  				gettext "Unknow command: $cmd"