From 60ec2821e2fb6fa4851023644eb1e94fa2bc3fdb Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Tue, 27 Dec 2022 10:38:26 +0100 Subject: [PATCH] postinst - add default value --- DEBIAN/postinst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DEBIAN/postinst b/DEBIAN/postinst index dc5ee05..99e3e41 100644 --- a/DEBIAN/postinst +++ b/DEBIAN/postinst @@ -46,7 +46,8 @@ openssl genrsa -out $CONFIG_DIR/instance.private.pem 2048 openssl rsa -in $CONFIG_DIR/instance.private.pem -outform PEM -pubout -out $CONFIG_DIR/instance.public.pem while true; do - read -p "> Do you wish to create self-signed webserver certificate? [y/n]" yn + read -p "> Do you wish to create self-signed webserver certificate? [Y/n]" yn + yn=${yn:-y} # ${parameter:-word} If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted. case $yn in [Yy]*) openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout $CONFIG_DIR/webserver.key -out $CONFIG_DIR/webserver.crt