summarylogtreecommitdiffstats
path: root/remoteit.install
blob: 30ffb1ccd8e561f6fdc2742433b2051b88c13fda (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
85
86
87
88
89
90
91
92
93
94
95
# This is a default template for a post-install scriptlet.
# Uncomment only required functions and remove any functions
# you don't need (and this header).

## arg 1:  the new package version
pre_install() {

  if [ -d /opt/remoteit-headless ]; then
    remoteit agent uninstall -y 2>/dev/null || true
    systemctl disable --now avahi-alias@remoteit.local 2>/dev/null || true
    systemctl disable --now remoteit-headless 2>/dev/null || true
    systemctl disable --now connectd 2>/dev/null || true
    systemctl disable --now connectd_schannel 2>/dev/null || true
    rm -f /usr/lib/systemd/system/avahi-alias@remoteit.local.service
    rm -rf /opt/remoteit-headless
    rm -f /usr/bin/remoteit
    rm -f /usr/bin/connectd
    rm -f /usr/bin/muxer
    rm -f /usr/bin/demuxer
    rm -f /usr/bin/connectd_task_notify
    mkdir -p /etc/remoteit
    rm -f /etc/remoteit/config.json-*
  fi

  exit 0

}

## arg 1:  the new package version
post_install() {

  . /usr/share/remoteit/functions.sh

  r3_install_agent

  exit 0

}

## arg 1:  the new package version
## arg 2:  the old package version
pre_upgrade() {

  if [ -d /opt/remoteit-headless ]; then
    remoteit agent uninstall -y 2>/dev/null || true
    systemctl disable --now avahi-alias@remoteit.local 2>/dev/null || true
    systemctl disable --now remoteit-headless 2>/dev/null || true
    systemctl disable --now connectd 2>/dev/null || true
    systemctl disable --now connectd_schannel 2>/dev/null || true
    rm -f /usr/lib/systemd/system/avahi-alias@remoteit.local.service
    rm -rf /opt/remoteit-headless
    rm -f /usr/bin/remoteit
    rm -f /usr/bin/connectd
    rm -f /usr/bin/muxer
    rm -f /usr/bin/demuxer
    rm -f /usr/bin/connectd_task_notify
    mkdir -p /etc/remoteit
    rm -f /etc/remoteit/config.json-*
  fi

  exit 0

}

## arg 1:  the new package version
## arg 2:  the old package version
post_upgrade() {

  . /usr/share/remoteit/functions.sh

  r3_install_agent

  exit 0

}

## arg 1:  the old package version
pre_remove() {

  . /usr/share/remoteit/functions.sh

  r3_remove_agent

  exit 0

}

## arg 1:  the old package version
post_remove() {

  rm -rf /etc/remoteit

  exit 0

}