tazpanel view tazpanel @ rev 338
settings.cgi: set tz
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jan 02 14:12:12 2013 +0100 (2013-01-02) |
parents | b6f8e363b864 |
children | bb7e9e0838e5 |
line source
1 #!/bin/sh
2 #
3 # Tiny Tazpanel cmdline interface
4 #
5 # Copyright (C) 2012 SliTaz GNU/Linux - BSD License
6 #
7 VERSION=1.4.3
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 NAME=tazpanel
29 DESC="SliTaz administration and configuration panel."
30 DAEMON=/usr/sbin/httpd
31 PIDFILE=/var/run/$NAME.pid
33 case "$1" in
34 start)
35 eval_gettext 'Starting TazPanel web server on port $HTTPD_PORT...'
36 httpd -p $HTTPD_PORT -u root -c $HTTPD_CONF \
37 -r "$(gettext 'TazPanel Authentication - Default: root:root')" &
38 ps | grep "httpd -p $HTTPD_PORT " | grep -v grep | \
39 awk '{ print $1 }' > $PIDFILE
40 status ;;
41 stop)
42 gettext 'Stopping TazPanel web server...'
43 kill $(cat $PIDFILE) && status ;;
44 passwd|-p)
45 echo ""
46 gettext 'Changing password for TazPanel'; echo
47 gettext 'New password: ' && read pass
48 sed -i s"/\/:root:.*/\/:root:$pass/" $HTTPD_CONF
49 gettext 'Password changed successfully'; echo
50 echo "" ;;
51 *)
52 program_name="$(basename $0)"
53 echo ""
54 eval_gettext 'Usage: $program_name [start|stop|passwd]'
55 echo "" ;;
56 esac
58 exit 0