1 #!/bin/sh /etc/rc.common
4 ENGINES_CNF_D
="/etc/ssl/engines.cnf.d"
5 ENGINES_CNF
="/var/etc/ssl/engines.cnf"
6 ENGINES_DIR
="%ENGINES_DIR%"
10 config_get_bool enabled
"$1" enabled
1
11 config_get_bool force
"$1" force
0
12 [ "$enabled" = 0 ] && return
13 if [ "$force" = 0 ] && \
14 [ ! -f "${ENGINES_CNF_D}/$1.cnf" ] && \
15 [ ! -f "${ENGINES_DIR}/$1.so" ]; then
16 echo Skipping engine
"$1": not installed
19 echo Enabling engine
"$1"
20 echo "$1=$1" >> "${ENGINES_CNF}"
24 mkdir
-p "$(dirname "${ENGINES_CNF}")" ||
exit 1
25 echo Generating engines.cnf
26 echo "# This file is automatically generated from /etc/config/openssl." \
27 > "${ENGINES_CNF}" || \
28 { echo Error writing
${ENGINES_CNF} >&2; exit 1; }
30 config_foreach config_engine engine