mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-01-15 13:17:26 +00:00
refactored dotnet core project name.
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<ApplicationIcon>logo2.ico</ApplicationIcon>
|
||||
<Version>5.5</Version>
|
||||
<Company>Technitium</Company>
|
||||
<Product>Technitium DNS Server</Product>
|
||||
<Authors>Shreyas Zare</Authors>
|
||||
<AssemblyName>DnsServerApp</AssemblyName>
|
||||
<RootNamespace>DnsServerApp</RootNamespace>
|
||||
<StartupObject>DnsServerApp.Program</StartupObject>
|
||||
<AssemblyVersion>5.5.0.0</AssemblyVersion>
|
||||
<FileVersion>5.5.0.0</FileVersion>
|
||||
<PackageProjectUrl>https://technitium.com/dns/</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/TechnitiumSoftware/DnsServer</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="start.bat" />
|
||||
<None Remove="start.sh" />
|
||||
<None Remove="supervisor.conf" />
|
||||
<None Remove="systemd.service" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="start.bat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="start.sh">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="supervisor.conf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="systemd.service">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DnsServerCore\DnsServerCore.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
Technitium DNS Server
|
||||
Copyright (C) 2020 Shreyas Zare (shreyas@technitium.com)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
using DnsServerCore;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace DnsServerApp
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string configFolder = null;
|
||||
|
||||
if (args.Length == 1)
|
||||
configFolder = args[0];
|
||||
|
||||
EventWaitHandle waitHandle = new ManualResetEvent(false);
|
||||
EventWaitHandle exitHandle = new ManualResetEvent(false);
|
||||
WebService service = null;
|
||||
|
||||
try
|
||||
{
|
||||
service = new WebService(configFolder, new Uri("https://go.technitium.com/?id=21"));
|
||||
service.Start();
|
||||
|
||||
Console.CancelKeyPress += delegate (object sender, ConsoleCancelEventArgs e)
|
||||
{
|
||||
e.Cancel = true;
|
||||
waitHandle.Set();
|
||||
};
|
||||
|
||||
AppDomain.CurrentDomain.ProcessExit += delegate (object sender, EventArgs e)
|
||||
{
|
||||
waitHandle.Set();
|
||||
exitHandle.WaitOne();
|
||||
};
|
||||
|
||||
Console.WriteLine("Technitium DNS Server was started successfully.");
|
||||
Console.WriteLine("Using config folder: " + service.ConfigFolder);
|
||||
Console.WriteLine("");
|
||||
Console.WriteLine("Note: Open http://" + service.WebServiceHostname + ":" + service.WebServicePort + "/ in web browser to access web console.");
|
||||
Console.WriteLine("");
|
||||
Console.WriteLine("Press [CTRL + C] to stop...");
|
||||
|
||||
waitHandle.WaitOne();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
Console.WriteLine("");
|
||||
Console.WriteLine("Technitium DNS Server is stopping...");
|
||||
|
||||
if (service != null)
|
||||
service.Dispose();
|
||||
|
||||
Console.WriteLine("Technitium DNS Server was stopped successfully.");
|
||||
exitHandle.Set();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.3 KiB |
@@ -1 +0,0 @@
|
||||
dotnet DnsServerApp.dll
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
dotnet DnsServerApp.dll
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
dotnetDir="/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
|
||||
|
||||
rm /etc/resolv.conf >/dev/null 2>&1
|
||||
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
|
||||
echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
||||
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 $dotnetDir ]
|
||||
then
|
||||
echo "Uninstalling .NET Core Runtime..."
|
||||
rm /usr/bin/dotnet >/dev/null 2>&1
|
||||
rm -rf $dotnetDir >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Thank you for using Technitium DNS Server!"
|
||||
Reference in New Issue
Block a user