xref: /illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/net-tcpkey (revision 1edba515a3484e0f74b638b203d462b3112ac84d)
1*1edba515SAndy Fiddaman#!/sbin/sh
2*1edba515SAndy Fiddaman#
3*1edba515SAndy Fiddaman# This file and its contents are supplied under the terms of the
4*1edba515SAndy Fiddaman# Common Development and Distribution License ("CDDL"), version 1.0.
5*1edba515SAndy Fiddaman# You may only use this file in accordance with the terms of version
6*1edba515SAndy Fiddaman# 1.0 of the CDDL.
7*1edba515SAndy Fiddaman#
8*1edba515SAndy Fiddaman# A full copy of the text of the CDDL should have accompanied this
9*1edba515SAndy Fiddaman# source. A copy of the CDDL is also available via the Internet at
10*1edba515SAndy Fiddaman# http://www.illumos.org/license/CDDL.
11*1edba515SAndy Fiddaman
12*1edba515SAndy Fiddaman#
13*1edba515SAndy Fiddaman# Copyright 2024 Oxide Computer Company
14*1edba515SAndy Fiddaman#
15*1edba515SAndy Fiddaman
16*1edba515SAndy Fiddaman. /lib/svc/share/smf_include.sh
17*1edba515SAndy Fiddaman
18*1edba515SAndy Fiddamanif [ -z "$SMF_FMRI" ]; then
19*1edba515SAndy Fiddaman	echo "This script can only be invoked by smf"
20*1edba515SAndy Fiddaman	exit $SMF_EXIT_ERR_NOSMF
21*1edba515SAndy Fiddamanfi
22*1edba515SAndy Fiddaman
23*1edba515SAndy Fiddaman# This service does nothing in a shared IP zone
24*1edba515SAndy Fiddamansmf_configure_ip || exit $SMF_EXIT_NODAEMON
25*1edba515SAndy Fiddaman
26*1edba515SAndy Fiddamantypeset -r CFG="$1"
27*1edba515SAndy Fiddamanif [[ -z "$CFG" ]]; then
28*1edba515SAndy Fiddaman	echo "Configuration file is not set."
29*1edba515SAndy Fiddaman	exit $SMF_EXIT_ERR_FATAL
30*1edba515SAndy Fiddamanfi
31*1edba515SAndy Fiddamanif [[ ! -r "$CFG" ]]; then
32*1edba515SAndy Fiddaman	echo "Configuration file '$CFG' cannot be read."
33*1edba515SAndy Fiddaman	exit $SMF_EXIT_ERR_FATAL
34*1edba515SAndy Fiddamanfi
35*1edba515SAndy Fiddaman
36*1edba515SAndy Fiddaman/usr/sbin/tcpkey -f "$CFG" || exit $SMF_EXIT_ERR_FATAL
37*1edba515SAndy Fiddamanexit $SMF_EXIT_OK
38