summarylogtreecommitdiffstats
path: root/asix-ax99100-install.sh
blob: 330ec48587105bcc95cd922ad40c162dbb05c239 (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
_pkgname='asix-ax99100'
_modulename='ax99100'

post_upgrade() {
  set -u
  systemctl daemon-reload
  if [ ! -d "/usr/src/${_pkgname}"-*/ ]; then
    depmod -a
    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() {
  set -u
  post_upgrade
  set +u
}

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

post_remove() {
  systemctl daemon-reload
}