uninstall.sh 869 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. dotnetDir="/opt/dotnet"
  3. dnsDir="/etc/dns"
  4. echo ""
  5. echo "================================="
  6. echo "Technitium DNS Server Uninstaller"
  7. echo "================================="
  8. echo ""
  9. echo "Uninstalling Technitium DNS Server..."
  10. if [ -d $dnsDir ]
  11. then
  12. if [ "$(ps --no-headers -o comm 1 | tr -d '\n')" = "systemd" ]
  13. then
  14. sudo systemctl disable dns.service >/dev/null 2>&1
  15. sudo systemctl stop dns.service >/dev/null 2>&1
  16. rm /etc/systemd/system/dns.service >/dev/null 2>&1
  17. rm /etc/resolv.conf >/dev/null 2>&1
  18. echo "nameserver 8.8.8.8" >> /etc/resolv.conf
  19. echo "nameserver 1.1.1.1" >> /etc/resolv.conf
  20. fi
  21. rm -rf $dnsDir >/dev/null 2>&1
  22. if [ -d $dotnetDir ]
  23. then
  24. echo "Uninstalling .NET Runtime..."
  25. rm /usr/bin/dotnet >/dev/null 2>&1
  26. rm -rf $dotnetDir >/dev/null 2>&1
  27. fi
  28. fi
  29. echo ""
  30. echo "Thank you for using Technitium DNS Server!"