removed old bash scripts.

This commit is contained in:
Shreyas Zare
2020-07-18 17:02:04 +05:30
parent e20e19e407
commit f1712674e9
4 changed files with 0 additions and 281 deletions

View File

@@ -1,109 +0,0 @@
#!/bin/sh
aspnetcoreDir="/opt/dotnet"
aspnetcoreTestDir="/opt/dotnet/shared/Microsoft.NETCore.App/3.1.5/"
aspnetcoreTar="/opt/dotnet/aspnetcore-runtime-3.1.5-linux-arm.tar.gz"
aspnetcoreUrl="https://download.visualstudio.microsoft.com/download/pr/7e519c5b-b434-4067-bc0b-bb38179f7e4f/80a840dc7fb2c4a065f442aea1d98516/aspnetcore-runtime-3.1.5-linux-arm.tar.gz"
dnsDir="/etc/dns"
dnsTar="/etc/dns/DnsServerPortable.tar.gz"
dnsUrl="https://download.technitium.com/dns/DnsServerPortable.tar.gz"
mkdir -p $dnsDir
installLog="$dnsDir/install.log"
echo "" > $installLog
echo ""
echo "==============================="
echo "Technitium DNS Server Installer"
echo "==============================="
echo ""
if [ -d "$aspnetcoreTestDir" ] && [ -f "/usr/bin/dotnet" ]
then
echo ".NET Core Runtime was found installed."
else
echo "Installing dependencies..."
until apt-get -y update >> $installLog 2>&1 && apt-get -y install curl libunwind8 gettext apt-transport-https >> $installLog 2>&1
do
echo "Trying again.."
sleep 2
done
echo ""
echo "Downloading .NET Core Runtime..."
mkdir -p $aspnetcoreDir
if wget -q "$aspnetcoreUrl" -O $aspnetcoreTar
then
echo "Installing .NET Core Runtime..."
tar -zxf $aspnetcoreTar -C $aspnetcoreDir >> $installLog 2>&1
if [ ! -f "/usr/bin/dotnet" ]
then
ln -s $aspnetcoreDir/dotnet /usr/bin
fi
echo ".NET Core Runtime was installed succesfully."
else
echo "Failed to download .NET Core Runtime from: $aspnetcoreUrl"
exit 1
fi
fi
echo ""
echo "Downloading Technitium DNS Server..."
if wget -q "$dnsUrl" -O $dnsTar
then
if [ -f "/etc/dns/DnsServerApp.dll" ]
then
echo "Updating Technitium DNS Server..."
else
echo "Installing Technitium DNS Server..."
fi
tar -zxf $dnsTar -C $dnsDir >> $installLog 2>&1
if [ "$(ps --no-headers -o comm 1 | tr -d '\n')" = "systemd" ]
then
if [ -f "/etc/systemd/system/dns.service" ]
then
echo "Restarting systemd service..."
systemctl restart dns.service >> $installLog 2>&1
else
echo "Configuring systemd service..."
cp $dnsDir/systemd.service /etc/systemd/system/dns.service
systemctl enable dns.service >> $installLog 2>&1
systemctl start dns.service >> $installLog 2>&1
fi
else
if [ -f "/etc/supervisor/conf.d/dns.conf" ]
then
echo "Restarting supervisor service..."
service supervisor restart >> $installLog 2>&1
else
echo "Installing supervisor..."
until apt-get -y install supervisor >> $installLog 2>&1
do
echo "Trying again.."
sleep 2
done
echo "Configuring supervisor service..."
cp $dnsDir/supervisor.conf /etc/supervisor/conf.d/dns.conf
service supervisor restart >> $installLog 2>&1
fi
fi
echo ""
echo "Technitium DNS Server was installed succesfully!"
echo "Open http://$(hostname):5380/ to access the web console."
else
echo ""
echo "Failed to download Technitium DNS Server from: $dnsUrl"
exit 1
fi

View File

@@ -1,97 +0,0 @@
#!/bin/sh
dnsDir="/etc/dns"
dnsTar="/etc/dns/DnsServerPortable.tar.gz"
dnsUrl="https://download.technitium.com/dns/DnsServerPortable.tar.gz"
mkdir -p $dnsDir
installLog="$dnsDir/install.log"
echo "" > $installLog
echo ""
echo "==============================="
echo "Technitium DNS Server Installer"
echo "==============================="
echo ""
echo "Installing .NET Core Runtime..."
if wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -r -s)/packages-microsoft-prod.deb" -O "$dnsDir/packages-microsoft-prod.deb"
then
dpkg -i "$dnsDir/packages-microsoft-prod.deb">> $installLog 2>&1
add-apt-repository universe >> $installLog 2>&1
until apt-get -y update >> $installLog 2>&1 && apt-get -y install libunwind8 icu-devtools apt-transport-https aspnetcore-runtime-3.1 >> $installLog 2>&1
do
echo "Trying again.."
sleep 2
done
echo ".NET Core Runtime was installed succesfully."
else
echo ""
echo "Failed to install .NET Core Runtime. Please try again."
exit 1
fi
echo ""
echo "Downloading Technitium DNS Server..."
if wget -q "$dnsUrl" -O $dnsTar
then
if [ -f "/etc/dns/DnsServerApp.dll" ]
then
echo "Updating Technitium DNS Server..."
else
echo "Installing Technitium DNS Server..."
fi
tar -zxf $dnsTar -C $dnsDir >> $installLog 2>&1
if [ "$(ps --no-headers -o comm 1 | tr -d '\n')" = "systemd" ]
then
if [ -f "/etc/systemd/system/dns.service" ]
then
echo "Restarting systemd service..."
systemctl restart dns.service >> $installLog 2>&1
else
echo "Configuring systemd service..."
cp $dnsDir/systemd.service /etc/systemd/system/dns.service
systemctl enable dns.service >> $installLog 2>&1
systemctl disable systemd-resolved >> $installLog 2>&1
systemctl stop systemd-resolved >> $installLog 2>&1
systemctl start dns.service >> $installLog 2>&1
rm /etc/resolv.conf
echo "nameserver 127.0.0.1" > /etc/resolv.conf
fi
else
if [ -f "/etc/supervisor/conf.d/dns.conf" ]
then
echo "Restarting supervisor service..."
service supervisor restart >> $installLog 2>&1
else
echo "Installing supervisor..."
until apt-get -y install supervisor >> $installLog 2>&1
do
echo "Trying again.."
sleep 2
done
echo "Configuring supervisor service..."
cp $dnsDir/supervisor.conf /etc/supervisor/conf.d/dns.conf
service supervisor restart >> $installLog 2>&1
fi
fi
echo ""
echo "Technitium DNS Server was installed succesfully!"
echo "Open http://$(hostname):5380/ to access the web console."
else
echo ""
echo "Failed to download Technitium DNS Server from: $dnsUrl"
exit 1
fi

View File

@@ -1,37 +0,0 @@
#!/bin/sh
aspnetcoreDir="/opt/dotnet"
dnsDir="/etc/dns"
echo ""
echo "================================="
echo "Technitium DNS Server Uninstaller"
echo "================================="
echo ""
echo "Uninstalling Technitium DNS Server..."
if [ -d $dnsDir ]
then
if [ "$(ps --no-headers -o comm 1 | tr -d '\n')" = "systemd" ]
then
sudo systemctl disable dns.service >/dev/null 2>&1
sudo systemctl stop dns.service >/dev/null 2>&1
rm /etc/systemd/system/dns.service >/dev/null 2>&1
else
rm /etc/supervisor/conf.d/dns.conf >/dev/null 2>&1
service supervisor restart >/dev/null 2>&1
fi
rm -rf $dnsDir >/dev/null 2>&1
if [ -d $aspnetcoreDir ]
then
echo "Uninstalling .NET Core Runtime..."
rm /usr/bin/dotnet >/dev/null 2>&1
rm -rf $aspnetcoreDir >/dev/null 2>&1
fi
fi
echo ""
echo "Thank you for using Technitium DNS Server!"

View File

@@ -1,38 +0,0 @@
#!/bin/sh
dnsDir="/etc/dns"
echo ""
echo "================================="
echo "Technitium DNS Server Uninstaller"
echo "================================="
echo ""
echo "Uninstalling Technitium DNS Server..."
if [ -d $dnsDir ]
then
if [ "$(ps --no-headers -o comm 1 | tr -d '\n')" = "systemd" ]
then
sudo systemctl disable dns.service >/dev/null 2>&1
sudo systemctl stop dns.service >/dev/null 2>&1
rm /etc/systemd/system/dns.service >/dev/null 2>&1
systemctl enable systemd-resolved >/dev/null 2>&1
systemctl start systemd-resolved >/dev/null 2>&1
rm /etc/resolv.conf >/dev/null 2>&1
ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf >/dev/null 2>&1
else
rm /etc/supervisor/conf.d/dns.conf >/dev/null 2>&1
service supervisor restart >/dev/null 2>&1
fi
rm -rf $dnsDir >/dev/null 2>&1
echo "Uninstalling .NET Core Runtime..."
apt-get -y remove aspnetcore-runtime-3.1 dotnet-runtime-3.1 dotnet-host dotnet-hostfxr-3.1 dotnet-runtime-deps-3.1 >/dev/null 2>&1
fi
echo ""
echo "Thank you for using Technitium DNS Server!"