source: salt-libreoffice-addon/trunk/fuentes/debian/salt-libreoffice-addons.postinst @ 473

Last change on this file since 473 was 473, checked in by daduve, 3 years ago

Adding files

File size: 1.7 KB
Line 
1#!/bin/sh
2
3set -e
4
5USER_TO_RUN_UNOPKG="root"
6
7AUX_SUDO_USER=$SUDO_USER
8SUDO_USER=$USER_TO_RUN_UNOPKG
9
10VERSION_WHICH_FIX_IT="4.4.13~rc6"
11
12
13case $1 in
14
15        configure)
16                echo " [ Salt LibreOffice ] : Testing if your libreoffice installation can be damaged"
17                rc=0
18                dpkg --compare-versions $2 lt ${VERSION_WHICH_FIX_IT} || rc=1
19
20                # Quitar esta linea si hace falta
21                rc=1
22
23                if [ ${rc} -eq 0 ] ; then
24                        echo " [ Salt Libreoffice addons may be broken ] ... Fixing it!"
25                        find /home/ -wholename "*.config/libreoffice" -xtype d  -exec rm -rf {} \; || true     
26                else
27                        echo " [ Your installation seems to be correct ]"               
28                fi
29
30
31
32                echo " [ Salt LibreOffice ] : Removing old salt plugins"
33                echo " * The user is : $SUDO_USER"
34                su $USER_TO_RUN_UNOPKG -c "unopkg remove --shared org.openoffice.Office.addon.salt.trad 1>/dev/null 2>/dev/null" || echo " * Already uninstalled: org.openoffice.Office.addon.salt.trad"
35                su $USER_TO_RUN_UNOPKG -c "unopkg remove --shared org.openoffice.Office.addon.salt.util 1>/dev/null 2>/dev/null" || echo " * Already uninstalled: org.openoffice.Office.addon.salt.util"
36               
37                echo " [ Salt LibreOffice ] : Installing new libreoffice salt addon"
38                su $USER_TO_RUN_UNOPKG -c "unopkg add -v --shared /usr/share/salt-libreoffice-addons/saltutil.oxt" 1>/dev/null 2>/dev/null || echo " * Something happens with : /usr/share/salt-libreoffice-addons/saltutil.oxt"
39                su $USER_TO_RUN_UNOPKG -c "unopkg add -v --shared /usr/share/salt-libreoffice-addons/salttrad.oxt" 1>/dev/null 2>/dev/null || echo " * Something happens with : /usr/share/salt-libreoffice-addons/salttrad.oxt"
40
41                echo " * Remember open-close libreoffice at the first time"
42                ;;
43        *)
44                echo " [ Salt LibreOffice ] : Nothing to do"
45                ;;
46esac
47
48SUDO_USER=$AUX_SUDO_USER
49
50#DEBHELPER#
Note: See TracBrowser for help on using the repository browser.