~ubuntu-core-dev/update-notifier/ubuntu

« back to all changes in this revision

Viewing changes to debian/update-notifier-crash.conf

  • Committer: Balint Reczey
  • Date: 2020-06-11 18:46:02 UTC
  • Revision ID: balint.reczey@canonical.com-20200611184602-2rv1zan3xu723x2u
Moved to git at https://git.launchpad.net/update-notifier

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
description "Notification regarding a crash report"
2
 
author "Brian Murray <brian@ubuntu.com>"
3
 
 
4
 
start on (
5
 
    file FILE=/var/crash/*.crash EVENT=create or
6
 
    file FILE=/var/crash/*.crash EVENT=modify
7
 
)
8
 
 
9
 
env MATCH=NULL
10
 
instance $MATCH
11
 
 
12
 
script
13
 
DATE=$(date)
14
 
echo "$DATE crash report $MATCH detected"
15
 
if [ -e /var/lib/apport/autoreport ]; then
16
 
    echo "$DATE autoreporting enabled exiting"
17
 
    exit 0
18
 
fi
19
 
if [ -O $MATCH ]; then
20
 
    /usr/share/apport/apport-gtk
21
 
else
22
 
    SYSTEMCRASH=0
23
 
    /usr/share/apport/apport-checkreports --system || SYSTEMCRASH=$?
24
 
    if [ $SYSTEMCRASH -eq 0 ]; then
25
 
        # not in admin group return
26
 
        ADMIN=0
27
 
        groups | grep -qE "sudo|admin" || ADMIN=$?
28
 
        if [ $ADMIN -ne 0 ]; then
29
 
            exit 1
30
 
        fi
31
 
        # be nice and always ask first before firing up pkexec
32
 
        if [ -x /lib/udev/watershed ]; then
33
 
            /lib/udev/watershed sh -c '/usr/lib/update-notifier/system-crash-notification'
34
 
        else
35
 
            /usr/lib/update-notifier/system-crash-notification
36
 
        fi
37
 
    fi
38
 
fi
39
 
end script