2020-06-07 06:46:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-05-11 10:00:02 +00:00
|
|
|
if ! [ -f "${__object:?}/parameter/control-use-certs" ];
|
|
|
|
then
|
|
|
|
exit 0;
|
|
|
|
fi
|
|
|
|
|
2020-06-07 06:46:18 +00:00
|
|
|
UNBOUND_CERTS_DIR=/etc/unbound
|
|
|
|
|
2021-05-11 10:00:02 +00:00
|
|
|
if [ -f "${__object:?}/parameter/enable-rc" ]; then
|
2020-06-07 06:46:18 +00:00
|
|
|
echo "unbound-control-setup -d $UNBOUND_CERTS_DIR"
|
|
|
|
echo "chown unbound:unbound $UNBOUND_CERTS_DIR/*.pem $UNBOUND_CERTS_DIR/*.key"
|
|
|
|
fi
|
2020-06-07 08:34:35 +00:00
|
|
|
|
|
|
|
cat << EOF
|
|
|
|
if pgrep unbound; then
|
2021-05-11 10:00:02 +00:00
|
|
|
service ${__object_id:?} reload
|
2020-06-07 08:34:35 +00:00
|
|
|
else
|
2021-05-11 10:00:02 +00:00
|
|
|
service ${__object_id:?} start
|
2020-06-07 08:34:35 +00:00
|
|
|
fi
|
|
|
|
EOF
|