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