install.sh: added checks to detect if dotnet runtime is installed and same check again to confirm installation.

This commit is contained in:
Shreyas Zare
2021-01-03 16:45:19 +05:30
parent b4a9db7c5e
commit 5a17cba84e

View File

@@ -13,6 +13,12 @@ echo ""
echo "==============================="
echo "Technitium DNS Server Installer"
echo "==============================="
if dotnet --list-runtimes 2> /dev/null | grep -q "Microsoft.NETCore.App 5.0.";
then
echo ""
echo ".NET 5 Runtime is already installed."
else
echo ""
echo "Installing .NET 5 Runtime..."
@@ -23,6 +29,15 @@ then
ln -s $dotnetDir/dotnet /usr/bin >> $installLog 2>&1
fi
if dotnet --list-runtimes 2> /dev/null | grep -q "Microsoft.NETCore.App 5.0.";
then
echo ".NET 5 Runtime was installed succesfully!"
else
echo "Failed to install .NET 5 Runtime. Please try again."
exit 1
fi
fi
echo ""
echo "Downloading Technitium DNS Server..."
@@ -69,6 +84,7 @@ then
else
echo ""
echo "Failed to install Technitium DNS Server: systemd was not detected."
exit 1
fi
else
echo ""