File: unbound-control-setup-check-openssl.patch

package info (click to toggle)
unbound 1.17.1-2%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 30,012 kB
  • sloc: ansic: 119,510; sh: 6,164; yacc: 3,789; python: 1,935; makefile: 1,628; awk: 162; perl: 158; xml: 36
file content (22 lines) | stat: -rw-r--r-- 740 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From: Michael Tokarev <mjt@tls.msk.ru>
Date: Tue, 19 Apr 2022 18:14:01 +0300
Subject: unbound-control-setup: check openssl

Before doing anything, check if openssl binary (which we will use)
is available, and print a useful error message if it is not found.

diff --git a/smallapp/unbound-control-setup.sh.in b/smallapp/unbound-control-setup.sh.in
index eaf1d082..be804879 100644
--- a/smallapp/unbound-control-setup.sh.in
+++ b/smallapp/unbound-control-setup.sh.in
@@ -104,6 +104,10 @@ while getopts 'd:hr' arg; do
 done
 shift $((OPTIND - 1))
 
+if ! command -v openssl >/dev/null; then
+    echo "$0 requires openssl package to be installed to generate the keys." >&2
+    exit 1
+fi
 
 echo "setup in directory $DESTDIR"
 cd "$DESTDIR"