#!/bin/sh
#
# apachegui -  gui control program for apache 
# version 0.1
#
# Copyright (C) 2005 hdluc@yahoo.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
######################################################################
# variables
USER=zaurus
ID=`id -u`
OPIE_SH=/opt/QtPalmtop/bin/opie-sh
SUDO=/usr/bin/sudo
CONFIG=$1

# start here
P=`ps -ef|grep httpd|grep nobody`
if [ "$P" = "" ]; then
  STATUS="not running"
else
  STATUS="running" 
fi
TITLE="Apache Status: $STATUS"
M="please select command:" 
CONFIG=`apache|awk '{print $1}'|grep st | $OPIE_SH -i -t "$TITLE" -L "$M" -l -g 2>/dev/null` 
RESULT=`sudo apache $CONFIG|cut -d: -f2`
$OPIE_SH -m -t "Apache Control" -M "status:$RESULT" -g -i
