Totally rewrote CalcReserveCharge. It now gets the reservecharge from the categoryite...
[koha.git] / acqui.simple / z3950-daemon-launch.sh
1 #!/bin/sh
2
3 # $Id$
4
5 # Script to start Koha background Z39.50 search daemon
6
7 # Part of the Koha Library Mgmt System -  www.koha.org
8 # Licensed under the GPL
9
10 #----------------------------
11 # Call this script during system startup, such as from rc.local
12
13 # Bugs/To Do:
14 #   Needs SysV-type start/stop options
15
16
17 # Parse /etc/koha.conf
18 for line in `cat /etc/koha.conf` ; do
19     OIFS=$IFS
20     IFS='='
21     set -- $line
22     if [ $1 = 'intranetdir' ] ; then
23         intranetdir=$2
24     fi
25     if [ $1 = 'httpduser' ] ; then
26         httpduser=$2
27     fi
28     if [ $1 = 'kohalogdir' ] ; then
29         kohalogdir=$2
30     fi
31     IFS=$OIFS
32 done
33
34
35
36 #----------------------------
37 # User ID to run the daemon as.  Don't use "root"
38 RunAsUser=$httpduser
39
40 KohaZ3950Dir=$intranetdir/scripts/z3950daemon
41 export KohaZ3950Dir
42
43 #----------------------------
44 if [ ! -d $KohaZ3950Dir ]
45 then
46         echo ERROR: Cannot find Koha directory $KohaZ3950Dir
47         exit 1
48 fi
49
50 KohaZ3950Shell=$KohaZ3950Dir/z3950-daemon-shell.sh
51
52 if [ ! -x $KohaZ3950Shell ]
53 then
54         echo ERROR: Cannot find Koha Z39.50 daemon launcher $KohaZ3950Shell
55         exit 1
56 fi
57
58 su -s /bin/sh -c $KohaZ3950Shell - $RunAsUser &
59
60 exit
61
62 #--------------
63 # $Log$
64 # Revision 1.1.2.4  2002/07/25 17:34:02  tonnesen
65 # shell scripts now parse the config file to get working directories and apache
66 # userid
67 #
68 # Revision 1.1.2.3  2002/06/26 19:56:57  tonnesen
69 # Bug fix.  Single quotes were causing $KohaZ3950Shell variable to not get
70 # expanded
71 #
72 # Revision 1.1.2.2  2002/06/26 16:25:51  amillar
73 # Make directory variable name more explanatory
74 #