-
Notifications
You must be signed in to change notification settings - Fork 0
/
init_virtuoso.sh
executable file
·69 lines (42 loc) · 1.05 KB
/
init_virtuoso.sh
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
#!/bin/bash
which isql &> /dev/null
if [ $? != 0 ] ; then
echo "isql: command not found..."
echo "Please install Virtuoso (https://virtuoso.openlinksw.com/)."
exit 1
fi
if [ -z $VIRTUOSO_HOME ] ; then
echo "Need to set VIRTUOSO_HOME."
exit 1
fi
if [ ! -d $VIRTUOSO_HOME ] ; then
echo "$VIRTUOSO_HOME is not directory."
exit 1
fi
echo
echo "Do you want to initialize Virtuoso? (y [n]) ? "
read ans
case $ans in
y*|Y*) ;;
*)
echo skipped.
exit 1;;
esac
VIRTUOSO_DB_PORT=1111
VIRTUOSO_DB_USER=dba
VIRTUOSO_DB_PASS=dba
isql $VIRTUOSO_DB_PORT $VIRTUOSO_DB_USER $VIRTUOSO_DB_PASS exec="status();" &> /dev/null
if [ $? = 0 ] ; then
while true ; do
pidof virtuoso-t > /dev/null
if [ $? != 0 ] ; then
break
fi
echo "stop virtuoso (local)"
isql $VIRTUOSO_DB_PORT $VIRTUOSO_DB_USER $VIRTUOSO_DB_PASS -K
sleep 30
done
fi
VIRTUOSO_DATA_DIR=$VIRTUOSO_HOME/var/lib/virtuoso/db
rm -f $VIRTUOSO_DATA_DIR/virtuoso.db $VIRTUOSO_DATA_DIR/virtuoso.pxa $VIRTUOSO_DATA_DIR/virtuoso-temp.db $VIRTUOSO_DATA_DIR/virtuoso.trx
./start_virtuoso.sh