Permalink
Browse files

Update Debian post-remove script to kill Wader

  • Loading branch information...
1 parent e021f24 commit 71ac66493152a61024ce570b34f28f9dbf2ee634 @andrewbird committed Aug 21, 2012
Showing with 12 additions and 7 deletions.
  1. +12 −7 packaging/debian/generic/debian/wader-core.postrm
@@ -1,11 +1,16 @@
#!/bin/sh -e
-case "$1" in
- (remove)
- if [ -e /var/run/wader.pid ]; then
- kill -9 `cat /var/run/wader.pid` 2>/dev/null || true
- fi
- ;;
-esac
+get_pid() {
+ [ -n "$1" ] || return 0
+ [ -S /var/run/dbus/system_bus_socket ] || return 0
+
+ dbus-send --system --dest=org.freedesktop.DBus --print-reply \
+ /org/freedesktop/DBus org.freedesktop.DBus.GetConnectionUnixProcessID \
+ string:$1 2>/dev/null | awk '/uint32/ {print $2}'
+}
+
+if [ "$1" = "remove" ]; then
+ kill $(get_pid org.freedesktop.ModemManager) 2>/dev/null || true
+fi
#DEBHELPER#

0 comments on commit 71ac664

Please sign in to comment.