Compare commits

...
2 Commits
Author SHA1 Message Date
BlubbFish 852a096f1d [NF] Now sould dedect Strg+c on Linux 2018-05-15 20:52:54 +00:00
BlubbFish 69030796f5 [BF] Fixinig installations dpkg script 2018-05-15 19:04:19 +00:00
38 changed files with 53 additions and 19 deletions
+12
View File
@@ -11,6 +11,7 @@ namespace ZwayBot {
private readonly ZwayController zw; private readonly ZwayController zw;
private readonly Dictionary<String, AModul> moduls = new Dictionary<String, AModul>(); private readonly Dictionary<String, AModul> moduls = new Dictionary<String, AModul>();
private Boolean RunningProcess = true; private Boolean RunningProcess = true;
private System.Threading.Thread sig_thread;
private readonly ProgramLogger logger = new ProgramLogger(); private readonly ProgramLogger logger = new ProgramLogger();
public Program(String[] args) { public Program(String[] args) {
@@ -42,6 +43,16 @@ namespace ZwayBot {
} }
private void WaitForShutdown() { private void WaitForShutdown() {
this.sig_thread = new System.Threading.Thread(delegate() {
Mono.Unix.UnixSignal[] signals = new Mono.Unix.UnixSignal[] {
new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM),
new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGINT)
};
while (true) {
Int32 i = Mono.Unix.UnixSignal.WaitAny(signals, -1);
this.RunningProcess = false;
}
});
Console.CancelKeyPress += new ConsoleCancelEventHandler(this.SetupShutdown); Console.CancelKeyPress += new ConsoleCancelEventHandler(this.SetupShutdown);
while (this.RunningProcess) { while (this.RunningProcess) {
System.Threading.Thread.Sleep(100); System.Threading.Thread.Sleep(100);
@@ -59,6 +70,7 @@ namespace ZwayBot {
Console.WriteLine("Modul entladen: " + item.Key); Console.WriteLine("Modul entladen: " + item.Key);
} }
this.zw.Dispose(); this.zw.Dispose();
this.sig_thread.Abort();
} }
private void ModulEvents() { private void ModulEvents() {
+2 -2
View File
@@ -31,8 +31,8 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben: // übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.1")] [assembly: AssemblyVersion("1.4.3")]
[assembly: AssemblyFileVersion("1.4.1")] [assembly: AssemblyFileVersion("1.4.3")]
[assembly: NeutralResourcesLanguage("de-DE")] [assembly: NeutralResourcesLanguage("de-DE")]
// “Internet Of Things” icon by By Michael Wohlwend, US, from thenounproject.com. // “Internet Of Things” icon by By Michael Wohlwend, US, from thenounproject.com.
+11
View File
@@ -12,6 +12,8 @@
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@@ -51,6 +53,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="dpkg\preinst" /> <None Include="dpkg\preinst" />
<None Include="dpkg\postinst" />
<Compile Include="Events.cs" /> <Compile Include="Events.cs" />
<Compile Include="Interfaces\IForceLoad.cs" /> <Compile Include="Interfaces\IForceLoad.cs" />
<Compile Include="Moduls\AModul.cs" /> <Compile Include="Moduls\AModul.cs" />
@@ -150,6 +153,7 @@
<None Include="dpkg\make-deb.sh" /> <None Include="dpkg\make-deb.sh" />
<None Include="dpkg\prerm" /> <None Include="dpkg\prerm" />
<None Include="dpkg\zwaybot.service" /> <None Include="dpkg\zwaybot.service" />
<None Include="packages.config" />
<None Include="Resources\Icon.ico" /> <None Include="Resources\Icon.ico" />
<Content Include="Resources\icon.svg" /> <Content Include="Resources\icon.svg" />
</ItemGroup> </ItemGroup>
@@ -160,4 +164,11 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Mono.Posix.5.4.0.201\build\net45\Mono.Posix.targets" Condition="Exists('..\packages\Mono.Posix.5.4.0.201\build\net45\Mono.Posix.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Mono.Posix.5.4.0.201\build\net45\Mono.Posix.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Mono.Posix.5.4.0.201\build\net45\Mono.Posix.targets'))" />
</Target>
</Project> </Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
[modul] [modul]
config=public config=public
[cold] [cold]
@@ -1,4 +1,4 @@
[modul] [modul]
config=private config=private
[settings] [settings]
@@ -1,4 +1,4 @@
[names] [names]
2-0-37=Kühlschrank Schalter 2-0-37=Kühlschrank Schalter
2-0-49-4=Kühlschrank Leistung 2-0-49-4=Kühlschrank Leistung
2-0-50-0=Kühlschrank Verbrauch [kWh] 2-0-50-0=Kühlschrank Verbrauch [kWh]
@@ -1,4 +1,4 @@
[hot] [hot]
from=7-0-67-1:Level from=7-0-67-1:Level
to=8-0-67-1:Level;9-0-67-1:Level to=8-0-67-1:Level;9-0-67-1:Level
@@ -1,4 +1,4 @@
[modul] [modul]
config=private config=private
[settings] [settings]
@@ -1,4 +1,4 @@
[zway] [zway]
server=localhost server=localhost
user=admin user=admin
pass=pass pass=pass
@@ -1,3 +1,3 @@
[temp] [temp]
cron=30 * * * * cron=30 * * * *
devices=7-0-49-1,8-0-49-1,9-0-49-1,10-0-49-1,11-0-49-1 devices=7-0-49-1,8-0-49-1,9-0-49-1,10-0-49-1,11-0-49-1
Binary file not shown.
+1 -1
View File
@@ -1,4 +1,4 @@
[modul] [modul]
config=public config=public
[cold] [cold]
+1 -1
View File
@@ -1,4 +1,4 @@
[modul] [modul]
config=private config=private
[settings] [settings]
+1 -1
View File
@@ -1,4 +1,4 @@
[names] [names]
2-0-37=Kühlschrank Schalter 2-0-37=Kühlschrank Schalter
2-0-49-4=Kühlschrank Leistung 2-0-49-4=Kühlschrank Leistung
2-0-50-0=Kühlschrank Verbrauch [kWh] 2-0-50-0=Kühlschrank Verbrauch [kWh]
@@ -1,4 +1,4 @@
[hot] [hot]
from=7-0-67-1:Level from=7-0-67-1:Level
to=8-0-67-1:Level;9-0-67-1:Level to=8-0-67-1:Level;9-0-67-1:Level
+1 -1
View File
@@ -1,4 +1,4 @@
[modul] [modul]
config=private config=private
[settings] [settings]
@@ -1,4 +1,4 @@
[zway] [zway]
server=localhost server=localhost
user=admin user=admin
pass=pass pass=pass
@@ -1,3 +1,3 @@
[temp] [temp]
cron=30 * * * * cron=30 * * * *
devices=7-0-49-1,8-0-49-1,9-0-49-1,10-0-49-1,11-0-49-1 devices=7-0-49-1,8-0-49-1,9-0-49-1,10-0-49-1,11-0-49-1
+1 -1
View File
@@ -2,5 +2,5 @@ set /P maj=Enter Major Version:
set /P min=Enter Minor Version: set /P min=Enter Minor Version:
set /P bui=Enter Build Version: set /P bui=Enter Build Version:
bash.exe -c "./make-deb.sh %maj% %min% %bui%" bash.exe -c "./make-deb.sh %maj% %min% %bui% armhf"
pause pause
+4 -1
View File
@@ -9,6 +9,7 @@ DEBIAN="$ROOT/DEBIAN"
VMAJOR=$1 VMAJOR=$1
VMINOR=$2 VMINOR=$2
VBUILD=$3 VBUILD=$3
ARCHT=$4
mkdir -p $EXEC mkdir -p $EXEC
mkdir -p $CONFIG mkdir -p $CONFIG
@@ -17,8 +18,10 @@ mkdir -p $SYSTEMD
cp control $DEBIAN cp control $DEBIAN
cp preinst $DEBIAN cp preinst $DEBIAN
cp postinst $DEBIAN
cp prerm $DEBIAN cp prerm $DEBIAN
sed -i s/Version:\ x\.x-x/"Version: $VMAJOR.$VMINOR-$VBUILD"/ $DEBIAN/control sed -i s/Version:\ x\.x-x/"Version: $VMAJOR.$VMINOR-$VBUILD"/ $DEBIAN/control
sed -i s/Architecture:\ any/"Architecture: $ARCHT"/ $DEBIAN/control
chmod 755 $DEBIAN -R chmod 755 $DEBIAN -R
cp zwaybot.service $SYSTEMD cp zwaybot.service $SYSTEMD
@@ -30,5 +33,5 @@ cp $OUTPUT/config-example/* $CONFIG
cp $OUTPUT/control $EXEC/ -r cp $OUTPUT/control $EXEC/ -r
dpkg-deb --build $ROOT dpkg-deb --build $ROOT
mv $WORKDIR/deb.deb ../bin/Builds/"zwaybot_$VMAJOR.$VMINOR-$VBUILD.deb" mv $WORKDIR/deb.deb ../bin/Builds/$ARCHT/"zwaybot_$VMAJOR.$VMINOR-$VBUILD.deb"
rm $WORKDIR/deb -r rm $WORKDIR/deb -r
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
service zwaybot start
+2 -1
View File
@@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
service zwaybot stop service zwaybot stop
adduser --system zwaybot addgroup zwaybot
adduser --system --no-create-home --disabled-login --ingroup zwaybot zwaybot
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Mono.Posix" version="5.4.0.201" targetFramework="net471" />
</packages>