From d69d83392316cb1286a76bab2aeb96baa473ad77 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Tue, 17 Jan 2023 14:57:39 +0100 Subject: [PATCH] migrated "[[ ]]" if statements to "[ ]" --- .DEBIAN/postinst | 8 ++++---- .DEBIAN/postrm | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.DEBIAN/postinst b/.DEBIAN/postinst index fbf9b82..8213736 100644 --- a/.DEBIAN/postinst +++ b/.DEBIAN/postinst @@ -3,7 +3,7 @@ WORKING_DIR=/usr/share/fastapi-dls CONFIG_DIR=/etc/fastapi-dls -if [[ ! -f $CONFIG_DIR/instance.private.pem ]]; then +if [ ! -f $CONFIG_DIR/instance.private.pem ]; then echo "> Create dls-instance keypair ..." 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 @@ -12,8 +12,8 @@ else fi while true; do - [[ -f $CONFIG_DIR/webserver.key ]] && default_answer="N" || default_answer="Y" - [[ $default_answer == "Y" ]] && V="Y/n" || V="y/N" + [ -f $CONFIG_DIR/webserver.key ] && default_answer="N" || default_answer="Y" + [ $default_answer == "Y" ] && V="Y/n" || V="y/N" read -p "> Do you wish to create self-signed webserver certificate? [${V}]" yn yn=${yn:-$default_answer} # ${parameter:-word} If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted. case $yn in @@ -27,7 +27,7 @@ while true; do esac done -if [[ -f $CONFIG_DIR/webserver.key ]]; then +if [ -f $CONFIG_DIR/webserver.key ]; then echo "> Starting service ..." systemctl start fastapi-dls.service diff --git a/.DEBIAN/postrm b/.DEBIAN/postrm index b99d0fa..7c21ae7 100755 --- a/.DEBIAN/postrm +++ b/.DEBIAN/postrm @@ -1,6 +1,6 @@ #!/bin/bash -if [[ -f /etc/systemd/system/fastapi-dls.service ]]; then +if [ -f /etc/systemd/system/fastapi-dls.service ]; then echo "> Removing service file." rm /etc/systemd/system/fastapi-dls.service fi