tazpanel view tazpanel @ rev 160
en:html: tiny edits
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Wed Apr 20 20:17:46 2011 +0100 (2011-04-20) |
parents | dce3e66c3ba4 |
children | 79a21a44deab |
line source
1 #!/bin/sh
2 #
3 # Tiny Tazpanel cmdline interface
4 #
5 # Copyright (C) 2011 SliTaz GNU/Linux - BSD License
6 #
7 VERSION=1.0
9 # Get the configuration file and functions
10 CONFIG="/etc/slitaz/tazpanel.conf"
11 [ -f $CONFIG ] && . $CONFIG
12 [ -f data/tazpanel.conf ] && . data/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 # I18n
20 . /usr/bin/gettext.sh
21 TEXTDOMAIN='tazpanel'
22 export TEXTDOMAIN
24 #
25 # Commands
26 #
28 case "$1" in
29 start)
30 gettext "Starting TazPanel web server on port $HTTPD_PORT..."
31 httpd -p $HTTPD_PORT -u root -c $HTTPD_CONF \
32 -r "`gettext \"TazPanel Authentication\"`" &
33 status ;;
34 stop)
35 gettext "Stopping TazPanel web server..."
36 killall httpd && status ;;
37 passwd|-p)
38 echo ""
39 gettext "Changing password for TazPanel"
40 gettext "New password: " && read pass
41 sed -i s"/\/:root:.*/\/:root:$pass/" $HTTPD_CONF
42 gettext "Password changed successfully"; echo
43 echo "" ;;
44 *)
45 echo ""
46 gettext "Usage:" && echo "`basename $0` [start|stop|passwd]"; echo
47 echo "" ;;
48 esac
50 exit 0