mirror of
https://git.collinwebdesigns.de/oscar.krause/fastapi-dls.git
synced 2024-11-23 23:41:06 +03:00
postinst improvements
This commit is contained in:
parent
2340931a60
commit
b22613c337
@ -37,7 +37,8 @@ EOF
|
|||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
echo "> Writing default config parameters ..."
|
if [[ ! -f $CONFIG_DIR/env ]]; then
|
||||||
|
echo "> Writing initial config ..."
|
||||||
touch $CONFIG_DIR/env
|
touch $CONFIG_DIR/env
|
||||||
cat <<EOF >$CONFIG_DIR/env
|
cat <<EOF >$CONFIG_DIR/env
|
||||||
DLS_URL=127.0.0.1
|
DLS_URL=127.0.0.1
|
||||||
@ -48,6 +49,7 @@ INSTANCE_KEY_RSA=$CONFIG_DIR/instance.private.pem
|
|||||||
INSTANCE_KEY_PUB=$CONFIG_DIR/instance.public.pem
|
INSTANCE_KEY_PUB=$CONFIG_DIR/instance.public.pem
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
echo "> Create dls-instance keypair ..."
|
echo "> Create dls-instance keypair ..."
|
||||||
openssl genrsa -out $CONFIG_DIR/instance.private.pem 2048
|
openssl genrsa -out $CONFIG_DIR/instance.private.pem 2048
|
||||||
@ -72,7 +74,8 @@ if [[ -f $CONFIG_DIR/webserver.key ]]; then
|
|||||||
|
|
||||||
if [ -x "$(command -v curl)" ]; then
|
if [ -x "$(command -v curl)" ]; then
|
||||||
echo "> Testing API ..."
|
echo "> Testing API ..."
|
||||||
curl --insecure -X GET https://127.0.0.1/status
|
source $CONFIG_DIR/env
|
||||||
|
curl --insecure -X GET https://$DLS_URL:$DLS_PORT/status
|
||||||
else
|
else
|
||||||
echo "> Testing API failed, curl not available. Please test manually!"
|
echo "> Testing API failed, curl not available. Please test manually!"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user