blob: c7fa2815b441133f2c48b3746d107395f4917063 (
plain)
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
|
#!/bin/bash
USAGE="Usage: $0"
SCRIPTNAME=`basename "$0"`
PROGRAMDIR=`dirname "$0"`
OFFICEDIR="$PROGRAMDIR/.."
EXTENSIONDIR=$OFFICEDIR/share/extension/install
REGISTERFILE=$PROGRAMDIR/register.dat
UNOPKG=$PROGRAMDIR/unopkg
help()
{
echo
echo "Installation script for office extensions located in <office>/share/extension/install"
echo
echo "This installation script can be executed after successful installation of packages."
echo "Before uninstallation please execute the script \"deregister_extensions\" located next"
echo "to this script."
echo "Usage: $0"
echo "No parameter required."
echo
}
#
# This script is only for root installations
# (How about installations done with user privileges?)
#
# if [ $UID -ne 0 ]
# then
# printf "\nThis script is for installation only wiht administrative rights only\n"
# help
# exit 2
# fi
#
# Checking existence of unopkg in program directory
#
if [ ! -f "$UNOPKG" ]; then
echo "Error: File $UNOPKG does not exist"
exit 1
fi
if [ ! -x "$UNOPKG" ]; then
echo "Error: File $UNOPKG is not an executable file"
exit 1
fi
#
# Collecting all files located in share/install/extensions
#
FILELIST=`find $EXTENSIONDIR -type f -name "*.oxt" -print`
if [ -z "$FILELIST" ]
then
printf "\n$0: No extensions found in $EXTENSIONDIR\n"
exit 2
fi
echo
echo "Installing:"
for i in $FILELIST; do
echo `basename $i`
done
echo
for i in $FILELIST; do
COMMAND="$UNOPKG add --shared $i"
echo $COMMAND
$COMMAND
done
if [ -f $REGISTERFILE ]; then
rm $REGISTERFILE
fi
echo
echo "Installation done ..."
echo
exit 0
|