Debian Codegraph @

tools/prerm

raw
1 #/bin/sh
2 REINSTALL=0
3 if [ $# -eq 1 ] ; then
4 #Fedora runs prerm after postinst - reinstall(1), remove(0)
5 #Debian in newer versions sometimes has param remove
6 if [ "$1" = "1" ] ; then
7 REINSTALL=1
8 fi
9 fi
10
11 if [ -e /bin/wslinfo ] ; then
12 echo "Service Removed... (SystemV-WSL)"
13 else
14 if [ -e /bin/systemctl ] ; then
15 if [ $REINSTALL -eq 1 ] ; then
16 echo "Service Reinstall... (systemd)"
17 else
18 systemctl disable hardinfo2
19 echo "Service Removed... (systemd)"
20 fi
21 elif [ -e /sbin/chkconfig ] ; then
22 chkconfig hardinfo2 off
23 chkconfig --del hardinfo2
24 echo "Service Removed... (SystemV)"
25 else
26 update-rc.d hardinfo2 remove
27 echo "Service Removed... (SystemV-rc)"
28 fi
29 fi