summarylogtreecommitdiffstats
path: root/brscan3.install
blob: 4b1f28bfdcb79df6ef3c230da1f0648d89dd6836 (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

# new package version
devices_file="/usr/local/Brother/sane/brsanenetdevice3.cfg"

pre_install() {
  /bin/true
}

# new package version
post_install() {
  /usr/local/Brother/sane/setupSaneScan3 -i
  
}

# the new package version
# old package version
pre_upgrade() {
  # If user has already configured their scanner then make a config backup
  if [ -f $devices_file ]; then
    cp $devices_file $devices_file.backup || return 1
  fi
}

# new package version
# old package version
post_upgrade() {
  # After upgrade revert user's scanner config and delete a config backup
  if [ -f $devices_file.backup ]; then
    cp $devices_file.backup $devices_file || return 1
    rm $devices_file.backup || return 1
  fi
}

# old package version
pre_remove() {
  /usr/local/Brother/sane/setupSaneScan3 -e
  /bin/true
}

# old package version
post_remove() {
  /bin/true
}