xref: /aoo41x/main/padmin/source/spadmin.sh (revision cdf0e10c)
1#!/bin/sh
2#*************************************************************************
3#
4# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5#
6# Copyright 2000, 2010 Oracle and/or its affiliates.
7#
8# OpenOffice.org - a multi-platform office productivity suite
9#
10# This file is part of OpenOffice.org.
11#
12# OpenOffice.org is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Lesser General Public License version 3
14# only, as published by the Free Software Foundation.
15#
16# OpenOffice.org is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19# GNU Lesser General Public License version 3 for more details
20# (a copy is included in the LICENSE file that accompanied this code).
21#
22# You should have received a copy of the GNU Lesser General Public License
23# version 3 along with OpenOffice.org.  If not, see
24# <http://www.openoffice.org/license.html>
25# for a copy of the LGPLv3 License.
26#
27#*************************************************************************
28
29# enable file locking
30SAL_ENABLE_FILE_LOCKING=1
31export SAL_ENABLE_FILE_LOCKING
32
33# resolve installation directory
34sd_cwd="`pwd`"
35if [ -h "$0" ] ; then
36	sd_basename=`basename "$0"`
37 	sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
38    cd "`dirname "$0"`"
39    cd "`dirname "$sd_script"`"
40else
41    cd "`dirname "$0"`"
42fi
43sd_prog=`pwd`
44cd "$sd_cwd"
45
46#collect all bootstrap variables specified on the command line
47#so that they can be passed as arguments to javaldx later on
48for arg in $@
49do
50  case "$arg" in
51       -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
52  esac
53done
54
55# extend the ld_library_path for java: javaldx checks the sofficerc for us
56if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then
57    my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \
58        "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
59    if [ -n "$my_path" ] ; then
60        LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
61        export LD_LIBRARY_PATH
62    fi
63fi
64
65unset XENVIRONMENT
66
67# uncomment line below to disable anti aliasing of fonts
68# SAL_ANTIALIAS_DISABLE=true; export SAL_ANTIALIAS_DISABLE
69
70# Set PATH so that crash_report is found:
71PATH=$sd_prog${PATH+:$PATH}
72export PATH
73
74# execute binary
75exec "$sd_prog/../basis-link/program/spadmin.bin" "$@" \
76    "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"
77