File: hook

package info (click to toggle)
kxd 0.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 352 kB
  • sloc: python: 536; sh: 233; makefile: 64
file content (30 lines) | stat: -rwxr-xr-x 497 bytes parent folder | download | duplicates (3)
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
#!/bin/bash
#
# Example kxd hook, which uses the system's sendmail to send a notification
# via email.
#
# Note that if the script fails, kxd will NOT send the key.
#

echo "Date: $(date --rfc-2822)
From: $MAIL_FROM
To: $EMAIL_TO
Subject: Access to key $KEY_PATH

Key: $KEY_PATH
Accessed by: $REMOTE_ADDR
On: $(date)

Client certificate:
  Signature: ${CLIENT_CERT_SIGNATURE:0:40}...
  Subject: $CLIENT_CERT_SUBJECT

Authorizing chains:
  $CHAIN_0
  $CHAIN_1
  $CHAIN_2

" | sendmail -t

exit $?