systemd/debian/udev.prerm
Topi Miettinen 32c0a18d2b
Delete empty lines at end of file
Upstream commit hooks don't allow empty lines and of course they serve no
purpose.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2020-05-16 11:25:10 +03:00

32 lines
482 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#