#!/bin/bash # # Script by Silvio Rhatto (rhatto at riseup.net). # # This is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or any later version. # # This SlackBuild is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # $HOME/.openoffice32: # # chroot_script="/usr/bin/openoffice-chroot" # office="/opt/OpenOffice.org/program" # chroot="/usr/slack32" # wrapper="/usr/bin/openoffice-wrapper" # function eval_param { echo `grep -e "^$1=" $HOME/.openoffice32 | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | cut -d "#" -f 1` } if [ -f $HOME/.openoffice32 ]; then office="`eval_param office`" else office="/opt/OpenOffice.org/program" fi if [[ "$#" > 2 ]]; then for ((num = 3; num <= $#; num++)); do args="$args${!num}" done else unset args fi if [ -x $office/$1 ]; then if [ -z "$args" ]; then su $2 -c "export PATH=$PATH:/opt/kde/bin ; $office/$1" else su $2 -c "export PATH=$PATH:/opt/kde/bin ; $office/$1 \"$args\"" fi fi