tazpanel view tazpanel @ rev 56

Add a file view CASE so we can displa any file on the system (ex at boot.cgi with rcS.conf)
author Christophe Lincoln <pankso@slitaz.org>
date Sun Apr 10 20:20:19 2011 +0200 (2011-04-10)
parents cf15cb2ff715
children b898c9887a62
line source
1 #!/bin/sh
2 #
3 # Tiny Tazpanel cmdline interface
4 #
5 # Copyright (C) 2011 SliTaz GNU/Linux - GNU gpl v3
6 #
7 VERSION=1.0
9 # Get the configuration file and functions
10 CONFIG="/etc/slitaz/tazpanel.conf"
11 [ -f $CONFIG ] && . $CONFIG
12 [ -f tazpanel.conf ] && . tazpanel.conf
13 [ ! -f $PANEL/lib/libtazpanel ] && \
14 echo "No config file or libtazpanel found: $CONFIG" && exit 1
15 . $PANEL/lib/libtazpanel
16 . /usr/lib/slitaz/libtaz
17 source_lib commons
19 # Include gettext helper script.
20 . /usr/bin/gettext.sh
22 # Export package name for gettext.
23 TEXTDOMAIN='tazpanel'
24 export TEXTDOMAIN
26 #
27 # Commands
28 #
30 case "$1" in
31 start)
32 gettext "Starting TazPanel web server on port $HTTPD_PORT..."
33 httpd -p $HTTPD_PORT -u root -c $HTTPD_CONF \
34 -r "`gettext \"TazPanel Authentication\"`" &
35 status ;;
36 stop)
37 gettext "Stopping TazPanel web server..."
38 killall httpd && status ;;
39 passwd|-p)
40 echo ""
41 gettext "Changing password for TazPanel"
42 gettext "New password: " && read pass
43 sed -i s"/\/:root:.*/\/:root:$pass/" $HTTPD_CONF
44 gettext "Password changed successfully"; echo
45 echo "" ;;
46 *)
47 echo ""
48 gettext "Usage:" && echo "`basename $0` [start|stop|passwd]"; echo
49 echo "" ;;
50 esac
52 exit 0