systemd/debian/udev.prerm
Michael Biebl 93417d9013 Use more consistent shell script headers
Gbp-Dch: Ignore
2020-01-31 10:46:58 +01:00

33 lines
483 B
Bash

#!/bin/sh
set -e
# adapted from postinst
chrooted() {
if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ];
then
return 1
fi
return 0
}
kill_udevd() {
if [ -d /run/systemd/system ]; then
systemctl stop systemd-udevd-control.socket systemd-udevd-kernel.socket
systemctl stop systemd-udevd.service
else
invoke-rc.d udev stop
fi
}
case "$1" in
remove)
if ! chrooted; then
kill_udevd
fi
;;
esac
#DEBHELPER#