source: lliurex-smart/trunk/fuentes/debian/lliurex-smart.postinst @ 3223

Last change on this file since 3223 was 3223, checked in by hectorgh, 2 years ago

diversions changes

File size: 2.0 KB
Line 
1#!/bin/sh
2
3
4SMART_NOTEBOOK="/opt/SMART Technologies/Notebook Software/bin/Notebook/notebook"
5LLIUREX_SMART="/usr/bin/lliurex-notebook"
6
7BASH_MOD1="/opt/SMART Technologies/.store/smart-notebook/install/bash-path"
8BASH_MOD1_DIVERTED="$BASH_MOD1.diverted"
9BASH_MOD1_LLIUREX="/opt/lliurex-smart/notebook-bash-path"
10BASH_MOD2="/opt/SMART Technologies/.store/smart-product-drivers/install/bash-path"
11BASH_MOD2_DIVERTED="$BASH_MOD2.diverted"
12BASH_MOD2_LLIUREX="/opt/lliurex-smart/product-drivers-bash-path"
13
14
15case "$1" in
16
17        configure)
18               
19                # Sanity checks, testing previous installations
20
21                if [ ! -L "${SMART_NOTEBOOK}" ]; then
22
23                        mv "${SMART_NOTEBOOK}" "${SMART_NOTEBOOK}".bkp
24                        ln -s "${LLIUREX_SMART}" "${SMART_NOTEBOOK}"
25
26                else
27
28                        echo "[ LliureX Smart ] : Link is done, nothing to do"
29                        if [ -L "${SMART_NOTEBOOK}.bkp" ]; then
30                                echo "[ LliureX Smart ] , your origins are dark ... smart-notebook reinstall is needed"
31                                echo "[ LliureX Smart ] , for if the flies ...remove the loop of the dead"
32                                echo "[ Loop of the Dead detected... removing it ]"
33                                rm -f "${SMART_NOTEBOOK}.bkp" || true
34                        fi
35
36                fi
37
38       
39        if [ ! -f "$BASH_MOD1_DIVERTED" ]; then
40
41                dpkg-divert --add --package lliurex-smart --rename --divert "$BASH_MOD1_DIVERTED" "$BASH_MOD1"
42                ln -s "$BASH_MOD1_LLIUREX" "$BASH_MOD1"
43        fi
44
45        if [ ! -f "$BASH_MOD2_DIVERTED" ]; then
46                dpkg-divert --add --package lliurex-smart --rename --divert "$BASH_MOD2_DIVERTED" "$BASH_MOD2"
47                ln -s "$BASH_MOD2_LLIUREX" "$BASH_MOD2"
48        fi
49
50
51        if [ ! -L "/opt/lliurex-smart/notebook-software" ];then
52                ln -s "/opt/SMART Technologies/Notebook Software/bin" "/opt/lliurex-smart/notebook-software"
53        fi
54
55        if [ ! -L "/opt/lliurex-smart/smart-product-drivers" ];then
56                ln -s "/opt/SMART Technologies/SMART Product Drivers/bin" "/opt/lliurex-smart/smart-product-drivers"
57        fi
58
59
60
61        ;;
62
63        abort-upgrade|abort-remove|abort-deconfigure)
64       
65                exit 0
66                ;;
67
68        *)
69               
70                echo "postinst called with unknown argument \`$1'" >&2
71                exit 0
72        ;;
73
74esac
75
76
77#DEBHELPER#
78
79exit 0
Note: See TracBrowser for help on using the repository browser.