Commit | Line | Data |
---|---|---|
1831ae68 FD |
1 | #!/bin/bash |
2 | # | |
3 | # Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com> | |
4 | # | |
5 | # SPDX-License-Identifier: MIT | |
6 | ||
7 | EVENT_NAME=trigger_exemple:my_event | |
8 | TRIGGER_NAME=demo_trigger | |
9 | ||
10 | lttng list > /dev/null 2>&1 | |
11 | if [ $? -ne 0 ]; then | |
12 | echo "Could not connect to session daemon, are you sure it is running?" | |
13 | exit 1 | |
14 | fi | |
15 | ||
16 | echo "Registering a notification trigger named \"$TRIGGER_NAME\" for the $EVENT_NAME user-space event" | |
17 | lttng add-trigger --id $TRIGGER_NAME --condition on-event --userspace $EVENT_NAME --action notify | |
18 | ||
19 | ./notification-client $TRIGGER_NAME | |
20 |