mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2025-12-22 09:29:50 +00:00
install.sh: updated script to detect and update dotnet runtime.
This commit is contained in:
@@ -15,12 +15,27 @@ echo "Technitium DNS Server Installer"
|
|||||||
echo "==============================="
|
echo "==============================="
|
||||||
|
|
||||||
if dotnet --list-runtimes 2> /dev/null | grep -q "Microsoft.NETCore.App 5.0.";
|
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
|
then
|
||||||
echo ""
|
echo ""
|
||||||
echo ".NET 5 Runtime is already installed."
|
echo ".NET 5 Runtime is already installed."
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
echo "Installing .NET 5 Runtime..."
|
|
||||||
|
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
|
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.";
|
if dotnet --list-runtimes 2> /dev/null | grep -q "Microsoft.NETCore.App 5.0.";
|
||||||
then
|
then
|
||||||
echo ".NET 5 Runtime was installed succesfully!"
|
if [ "$dotnetUpdate" = "yes" ]
|
||||||
|
then
|
||||||
|
echo ".NET 5 Runtime was updated succesfully!"
|
||||||
|
else
|
||||||
|
echo ".NET 5 Runtime was installed succesfully!"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Failed to install .NET 5 Runtime. Please try again."
|
echo "Failed to install .NET 5 Runtime. Please try again."
|
||||||
exit 1
|
exit 1
|
||||||
@@ -43,7 +63,7 @@ echo "Downloading Technitium DNS Server..."
|
|||||||
|
|
||||||
if curl -o $dnsTar --fail $dnsUrl >> $installLog 2>&1
|
if curl -o $dnsTar --fail $dnsUrl >> $installLog 2>&1
|
||||||
then
|
then
|
||||||
if [ -d "/etc/dns/" ]
|
if [ -d $dnsDir ]
|
||||||
then
|
then
|
||||||
echo "Updating Technitium DNS Server..."
|
echo "Updating Technitium DNS Server..."
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user