~usb-creator-hackers/usb-creator/trunk

« back to all changes in this revision

Viewing changes to debian/usb-creator-common.prerm

  • Committer: Benjamin Drung
  • Date: 2022-11-02 13:01:26 UTC
  • Revision ID: benjamin.drung@canonical.com-20221102130126-4z0xyivy5f37dp13
Move to https://code.launchpad.net/~usb-creator-hackers/usb-creator/+git/main

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
set -e
4
 
 
5
 
get_pid() {
6
 
    [ -n "$1" ] || return 0
7
 
    [ -S /var/run/dbus/system_bus_socket ] || return 0
8
 
 
9
 
    dbus-send --system --dest=org.freedesktop.DBus --print-reply \
10
 
              /org/freedesktop/DBus org.freedesktop.DBus.GetConnectionUnixProcessID \
11
 
              string:$1 2>/dev/null | awk '/uint32/ {print $2}'
12
 
}
13
 
 
14
 
if [ "$1" = "remove" ]; then
15
 
    # stop usb-creator-helper
16
 
    kill $(get_pid com.ubuntu.USBCreator) 2>/dev/null || true
17
 
fi
18
 
 
19
 
#DEBHELPER#