-
Notifications
You must be signed in to change notification settings - Fork 142
/
webmin.functions.sh
27 lines (23 loc) · 827 Bytes
/
webmin.functions.sh
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
#!/usr/bin/env bash
#
# webmin functions
#
# (c) 2017-2018, Hetzner Online GmbH
#
regenerate_webmin_miniserv_ssl_certificate() {
local webmin_miniserv_ssl_certificate="$FOLD/hdd/etc/webmin/miniserv.pem"
debug '# regenerate webmin miniserv ssl certificate'
if [[ -e "$webmin_miniserv_ssl_certificate" ]]; then
rm "$webmin_miniserv_ssl_certificate" || return 1
fi
openssl req -days 1825 -keyout "$webmin_miniserv_ssl_certificate" \
-newkey rsa:2048 -nodes -out "$webmin_miniserv_ssl_certificate" -sha256 \
-subj "/CN=*/emailAddress=$USER@$(hostname)/O=Webmin Webserver on $(hostname)" \
-x509 |& debugoutput
(("${PIPESTATUS[0]}" == 0)) && [[ -e "$webmin_miniserv_ssl_certificate" ]]
}
setup_webmin() {
debug '# setup webmin'
regenerate_webmin_miniserv_ssl_certificate
}
# vim: ai:ts=2:sw=2:et