mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-01-05 16:24:52 +00:00
added uninstaller scripts for ubuntu and raspi
This commit is contained in:
37
DnsServerApp.NETCore/uninstall-raspi.sh
Normal file
37
DnsServerApp.NETCore/uninstall-raspi.sh
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/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!"
|
||||
38
DnsServerApp.NETCore/uninstall-ubuntu.sh
Normal file
38
DnsServerApp.NETCore/uninstall-ubuntu.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/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!"
|
||||
Reference in New Issue
Block a user