~azzar1/update-notifier/hide-livepatch-indicator-if-disabled

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
description "Notification regarding a crash report"
author "Brian Murray <brian@ubuntu.com>"

start on (
    file FILE=/var/crash/*.crash EVENT=create or
    file FILE=/var/crash/*.crash EVENT=modify
)

env MATCH=NULL
instance $MATCH

script
DATE=$(date)
echo "$DATE crash report $MATCH detected"
if [ -e /var/lib/apport/autoreport ]; then
    echo "$DATE autoreporting enabled exiting"
    exit 0
fi
if [ -O $MATCH ]; then
    /usr/share/apport/apport-gtk
else
    SYSTEMCRASH=0
    /usr/share/apport/apport-checkreports --system || SYSTEMCRASH=$?
    if [ $SYSTEMCRASH -eq 0 ]; then
        # not in admin group return
        ADMIN=0
        groups | grep -qE "sudo|admin" || ADMIN=$?
        if [ $ADMIN -ne 0 ]; then
            exit 1
        fi
        # be nice and always ask first before firing up pkexec
        if [ -x /lib/udev/watershed ]; then
            /lib/udev/watershed sh -c '/usr/lib/update-notifier/system-crash-notification'
        else
            /usr/lib/update-notifier/system-crash-notification
        fi
    fi
fi
end script