File: install_ini.sh.in

package info (click to toggle)
virtuoso-opensource 7.2.12%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 299,308 kB
  • sloc: ansic: 655,054; sql: 508,209; xml: 269,573; java: 84,064; javascript: 79,847; cpp: 37,662; sh: 32,429; cs: 25,702; php: 12,690; yacc: 11,666; lex: 7,933; makefile: 7,308; jsp: 4,523; awk: 1,719; perl: 1,013; ruby: 1,003; python: 326
file content (90 lines) | stat: -rw-r--r-- 1,854 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/sh

#
#  Settings from configure/make install
#
PREFIX="@PREFIX@"
DESTDIR="@DESTDIR@"
VADDIR="@VADDIR@"
DBDIR="@DBDIR@"
DEMODIR="@DEMODIR@"
HOSTINGDIR="@HOSTINGDIR@"
HTTPROOTDIR="@HTTPROOTDIR@"

#
#  Argument
#
DB=${1-database}


#
#  Calculate hostname
#
HOST=`hostname | tr '[a-z]' '[A-Z]' | sed -e 's/\..*$//' 2>/dev/null`
if test "x$HOST" = "x"
then
    HOST=localhost
fi


case $DB in
	database)
		PORT=1111
		HTTP_PORT=8890
		DBNAME=virtuoso
		DIR="$DBDIR"
		REPLNAME="db-$HOST"
		;;

	demo)
		PORT=1112
		HTTP_PORT=8891
		DBNAME=demo
		DIR="$DEMODIR"
		REPLNAME="demo-$HOST"
		;;

	*)
		echo "Unknown database name [$DB]"
		exit 1
		;;
esac


#
#  Generate proper ini file
#

if test -f "${DESTDIR}${DIR}/${DBNAME}.ini"
then
	INIFILE="${DESTDIR}${DIR}/${DBNAME}.ini.sample"
else
	INIFILE="${DESTDIR}${DIR}/${DBNAME}.ini"
fi
echo "Installing default ini file as $INIFILE"

sed	-e "s,[@]VADDIR[@],$VADDIR,g" \
	-e "s,[@]HOSTINGDIR[@],$HOSTINGDIR,g" \
	-e "s,[@]DBDIR[@],$DBDIR,g" \
	-e "s,[@]DBNAME[@],$DBNAME,g" \
	-e "s,[@]HOST[@],$HOST,g" \
	-e "s,[@]PORT[@],$PORT,g" \
	-e "s,[@]HTTP_PORT[@],$HTTP_PORT,g" \
	-e "s,[@]HTTP_ROOTDIR[@],$HTTPROOTDIR,g" \
	-e "s,[@]REPLNAME[@],$REPLNAME,g" \
	-e "s,[@]ZNAME[@],$DBNAME ($HOST),g" \
        -e 's,[@]REM_IM[@],@REM_IM@,g' \
        -e 's,[@]REM_HSL[@],@REM_HSL@,g' \
        -e 's,[@]REM_WBXML2[@],@REM_WBXML2@,g' \
        -e 's,[@]REM_PHP5[@],@REM_PHP5@,g' \
        -e 's,[@]REM_PYTHON[@],@REM_PYTHON@,g' \
        -e 's,[@]REM_PERL[@],@REM_PERL@,g' \
        -e 's,[@]REM_RUBY[@],@REM_RUBY@,g' \
        -e 's,[@]REM_PROJ4[@],@REM_PROJ4@,g' \
        -e 's,[@]REM_GEOS[@],@REM_GEOS@,g' \
        -e 's,[@]REM_SHAPEFILEIO[@],@REM_SHAPEFILEIO@,g' \
        -e 's,[@]REM_RUBY[@],@REM_RUBY@,g' \
        -e 's,[@]REM_GRAPHQL[@],@REM_GRAPHQL@,g' \
	< default-virtuoso.ini > "$INIFILE"

exit 0