aboutsummaryrefslogtreecommitdiffstats
path: root/packages/havp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'packages/havp.sh')
-rw-r--r--packages/havp.sh20
1 files changed, 18 insertions, 2 deletions
diff --git a/packages/havp.sh b/packages/havp.sh
index 5cc8c179..316fdcc1 100644
--- a/packages/havp.sh
+++ b/packages/havp.sh
@@ -1,14 +1,27 @@
#!/bin/sh
# HAVP Init script
# 6/23/06 - Gary Buckmaster
-
+# Modified by Rajkumar S.
+#
pidfile=/var/run/havp/havp.pid
+piddir=/var/run/havp/
+logdir=/var/log/havp/
required_dirs=/var/tmp/havp
required_files=/usr/local/etc/havp/havp.config
rc_start()
{
+ if [ ! -d $piddir ]
+ then
+ mkdir -p $piddir
+ chown havp:havp $piddir
+ fi
+ if [ ! -d $logdir ]
+ then
+ mkdir -p $logdir
+ chown havp:havp $logdir
+ fi
if [ ! -f $required_files ]
then
echo "FATAL: Missing HAVP config file: $required_files"
@@ -17,7 +30,8 @@ rc_start()
if [ ! -d $required_dirs ]
then
echo "FATAL: Missing HAVP working director: $required_dirs"
- return
+ mkdir -p $required_dirs
+ chown havp:havp $required_dirs
fi
if [ -f $pidfile ]
then
@@ -28,6 +42,7 @@ rc_start()
echo "Starting HAVP Antivirus HTTP Proxy"
/usr/local/sbin/havp &
sleep 4
+ /usr/local/pkg/havp_startup.inc
if [ -f $pidfile ]
then
pid=$(sed 's/ //g' $pidfile)
@@ -49,6 +64,7 @@ rc_stop()
else
echo "Stopping HAVP pid: $pid"
kill $pid
+ rm -f $required_dirs/*
fi
}