summarylogtreecommitdiffstats
path: root/digi-dgnc-install.sh
blob: 098b8cc8951b3ad8765e5e52d2298eaed163b334 (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
_pkgname='digi-dgnc'
_modulename='dgnc_digi'

post_upgrade() {
  set -u
  if [ ! -d "/usr/src/${_pkgname}"-*/ ]; then
    # depmod -a # now done by pacman hook
    if ! lsmod | cut -d' ' -f1 | grep -q "^${_modulename}"'$'; then
      #echo 'Reboot or load now with:'
      #echo "  sudo modprobe '${_modulename}'"
      modprobe "${_modulename}"
    fi
  fi
  set +u
}

post_install() {
  post_upgrade
}

pre_remove() {
  set -u
  if [ ! -d "/usr/src/${_pkgname}"-*/ ]; then
    rmmod "${_modulename}"
  fi
  set +u
}