forked from Eric-Brison/dynacase-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wstart
executable file
·64 lines (55 loc) · 1.54 KB
/
wstart
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
#!/bin/bash
DIRNAME=`dirname "$0"`
REAL_DIRNAME=`cd "$DIRNAME" 1> /dev/null 2>&1 && pwd`
if [ -z "$REAL_DIRNAME" ]; then
echo "Could not get real dir name from '$0'."
exit 1
fi
export wpub=$REAL_DIRNAME
core_environment="$wpub/programs/core_environment"
if [ ! -x "$core_environment" ]; then
echo "'$core_environment' not found or not executable."
exit 1
fi
. "$core_environment"
# link images file to be used in several applications
if [ ! -d "$wpub/Images" ] ; then
mkdir "$wpub/Images"
fi
if [ ! -d "$wpub/Docs" ] ; then
mkdir "$wpub/Docs"
fi
pushd "$wpub/Images" > /dev/null
ln -sf ../*/Images/* .
popd > /dev/null
rm -f "$wpub"/var/cache/image/*png
rm -f "$wpub"/var/cache/image/*gif
rm -f "$wpub"/var/cache/image/*xml
rm -f "$wpub"/var/cache/image/*src
rm -f "$wpub"/.autoloader.cache
pushd "$wpub/Docs" > /dev/null
ln -sf ../*/Docs/* .
popd > /dev/null
#refresh version identificator
"$wpub/wsh.php" --api=refreshjsversion >/dev/null
RET=$?
if [ $RET -ne 0 ]; then
echo "Error regenerating autoloader cache or refreshing JS version"
exit $RET
fi
#change pg mode connection
cdb=`"$wpub/wsh.php" --api=getApplicationParameter --param=CORE_DBCONNECT`
if [ "$cdb" == 'persistent' ] ; then
sed -ibak -e"s/pg_connect/pg_pconnect/g" "$wpub/WHAT/Lib.Common.php"
else
sed -ibak -e"s/pg_pconnect/pg_connect/g" "$wpub/WHAT/Lib.Common.php"
fi
"$wpub/wsh.php" --api=setStyle >/dev/null
RET=$?
if [ $RET -ne 0 ]; then
echo "Error setting style"
exit $RET
fi
if [ -f "$wpub/maintenance.lock" ]; then
rm -f "$wpub/maintenance.lock"
fi