File: prerm

package info (click to toggle)
hardinfo 2.2.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,040 kB
  • sloc: ansic: 40,169; cpp: 1,216; sh: 340; xml: 81; python: 50; makefile: 3
file content (29 lines) | stat: -rwxr-xr-x 721 bytes parent folder | download | duplicates (5)
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
#/bin/sh
REINSTALL=0
if [ $# -eq 1 ] ; then
  #Fedora runs prerm after postinst - reinstall(1), remove(0)
  #Debian in newer versions sometimes has param remove
  if [ "$1" = "1" ] ; then
    REINSTALL=1
  fi
fi

if [ -e /bin/wslinfo ] ; then
  echo "Service Removed... (SystemV-WSL)"
else
  if [ -e /bin/systemctl ] ; then
    if [ $REINSTALL -eq 1 ] ; then
      echo "Service Reinstall... (SystemD)"
    else
      systemctl disable hardinfo2
      echo "Service Removed... (SystemD)"
    fi
  elif [ -e /sbin/chkconfig ] ; then
    chkconfig hardinfo2 off
    chkconfig --del hardinfo2
    echo "Service Removed... (SystemV)"
  else
    update-rc.d hardinfo2 remove
    echo "Service Removed... (SystemV-rc)"
  fi
fi