slitaz-tools view installer/installer.sh @ rev 668

tazinst: add web frontend (warning: needs latest httpd_helper.sh from Busybox)
author Dominique Corbex <domcox@slitaz.org>
date Thu Aug 18 17:04:16 2011 +0200 (2011-08-18)
parents
children
line source
1 #!/bin/sh
2 #
3 # Launcher for installer.cgi
4 #
5 # Copyright (C) 2011 SliTaz GNU/Linux - GNU General Public License v3.
6 #
7 # Authors : Dominique Corbex <domcox@slitaz.org>
8 #
10 HTTPD_PORT=83
11 PIDFILE=/run/installer.pid
13 if (ps | grep httpd | grep -q "\-p $HTTPD_PORT"); then
14 export ALERT_DIALOG='
15 <vbox>
16 <pixmap icon_size="4">
17 <input file stock="gtk-dialog-warning"></input>
18 </pixmap>
19 <text>
20 <label>SliTaz Installer is already running!</label>
21 </text>
22 <hbox homogeneous="true">
23 <button cancel></button>
24 </hbox>
25 </vbox> '
26 gtkdialog --program=ALERT_DIALOG
27 else
28 # Start httpd
29 httpd -p $HTTPD_PORT -u root -f \
30 -r Installer Authentication - Default: root:root & \
31 ps | grep "httpd" | grep "\-p $HTTPD_PORT" | \
32 awk '{ print $1 }' > $PIDFILE
33 # Run Tazweb
34 tazweb localhost:83/installer/installer.cgi
35 # Stop httpd
36 kill $(cat $PIDFILE)
37 fi