Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update Debian post-remove script to kill Wader

  • Loading branch information...
commit 71ac66493152a61024ce570b34f28f9dbf2ee634 1 parent e021f24
Andrew Bird authored
19  packaging/debian/generic/debian/wader-core.postrm
... ...
@@ -1,11 +1,16 @@
1 1
 #!/bin/sh -e
2 2
 
3  
-case "$1" in
4  
-    (remove)
5  
-    if [ -e /var/run/wader.pid ]; then
6  
-        kill -9 `cat /var/run/wader.pid` 2>/dev/null || true
7  
-    fi
8  
-    ;;
9  
-esac
  3
+get_pid() {
  4
+    [ -n "$1" ] || return 0
  5
+    [ -S /var/run/dbus/system_bus_socket ] || return 0
  6
+
  7
+    dbus-send --system --dest=org.freedesktop.DBus --print-reply \
  8
+        /org/freedesktop/DBus org.freedesktop.DBus.GetConnectionUnixProcessID \
  9
+        string:$1 2>/dev/null | awk '/uint32/ {print $2}'
  10
+}
  11
+
  12
+if [ "$1" = "remove" ]; then
  13
+    kill $(get_pid org.freedesktop.ModemManager) 2>/dev/null || true
  14
+fi
10 15
 
11 16
 #DEBHELPER#

0 notes on commit 71ac664

Please sign in to comment.
Something went wrong with that request. Please try again.