mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2025-12-22 09:29:50 +00:00
install.sh: added checks to detect if dotnet runtime is installed and same check again to confirm installation.
This commit is contained in:
@@ -13,14 +13,29 @@ echo ""
|
|||||||
echo "==============================="
|
echo "==============================="
|
||||||
echo "Technitium DNS Server Installer"
|
echo "Technitium DNS Server Installer"
|
||||||
echo "==============================="
|
echo "==============================="
|
||||||
echo ""
|
|
||||||
echo "Installing .NET 5 Runtime..."
|
|
||||||
|
|
||||||
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
|
if dotnet --list-runtimes 2> /dev/null | grep -q "Microsoft.NETCore.App 5.0.";
|
||||||
|
|
||||||
if [ ! -f "/usr/bin/dotnet" ]
|
|
||||||
then
|
then
|
||||||
ln -s $dotnetDir/dotnet /usr/bin >> $installLog 2>&1
|
echo ""
|
||||||
|
echo ".NET 5 Runtime is already installed."
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo "Installing .NET 5 Runtime..."
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
if [ ! -f "/usr/bin/dotnet" ]
|
||||||
|
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
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
@@ -69,6 +84,7 @@ then
|
|||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
echo "Failed to install Technitium DNS Server: systemd was not detected."
|
echo "Failed to install Technitium DNS Server: systemd was not detected."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Reference in New Issue
Block a user