install.sh: updated script to detect and update dotnet runtime.

This commit is contained in:
Shreyas Zare
2021-02-13 14:48:24 +05:30
parent 1ec356a50d
commit dc3ae68598

View File

@@ -15,12 +15,27 @@ echo "Technitium DNS Server Installer"
echo "==============================="
if dotnet --list-runtimes 2> /dev/null | grep -q "Microsoft.NETCore.App 5.0.";
then
dotnetFound="yes"
else
dotnetFound="no"
fi
if [ ! -d $dotnetDir ] && [ "$dotnetFound" = "yes" ]
then
echo ""
echo ".NET 5 Runtime is already installed."
else
echo ""
if [ -d $dotnetDir ]
then
dotnetUpdate="yes"
echo "Updating .NET 5 Runtime..."
else
dotnetUpdate="no"
echo "Installing .NET 5 Runtime..."
fi
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -c 5.0 --runtime dotnet --no-path --install-dir $dotnetDir --verbose >> $installLog 2>&1
@@ -31,7 +46,12 @@ else
if dotnet --list-runtimes 2> /dev/null | grep -q "Microsoft.NETCore.App 5.0.";
then
if [ "$dotnetUpdate" = "yes" ]
then
echo ".NET 5 Runtime was updated succesfully!"
else
echo ".NET 5 Runtime was installed succesfully!"
fi
else
echo "Failed to install .NET 5 Runtime. Please try again."
exit 1
@@ -43,7 +63,7 @@ echo "Downloading Technitium DNS Server..."
if curl -o $dnsTar --fail $dnsUrl >> $installLog 2>&1
then
if [ -d "/etc/dns/" ]
if [ -d $dnsDir ]
then
echo "Updating Technitium DNS Server..."
else