summaryrefslogtreecommitdiffstats
path: root/stap-authorize-server-cert
blob: 33607b56dbc9a860e52d3506437f26fa8155acd0 (plain)
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

# Add an existing server certificate to the
# database of trusted SSL servers for the client.
#
# Copyright (C) 2009 Red Hat Inc.
#
# This file is part of systemtap, and is free software.  You can
# redistribute it and/or modify it under the terms of the GNU General
# Public License (GPL); either version 2, or (at your option) any
# later version.

# Initialize the environment
. ${PKGLIBEXECDIR}stap-env

certfile=$1
certdb=$2

# Obtain the filename of the certificate
if  test "X$certfile" = "X"; then
    echo "Certificate file must be specified" >&2
    exit 1
fi

# Obtain the certificate database directory name.
if  test "X$certdb" = "X"; then
    certdb=$stap_ssl_db/client
fi

${stap_pkglibexecdir}stap-authorize-cert $certfile $certdb