NetDetector 0.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package NetDetector --version 0.0.3                
NuGet\Install-Package NetDetector -Version 0.0.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetDetector" Version="0.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetDetector --version 0.0.3                
#r "nuget: NetDetector, 0.0.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NetDetector as a Cake Addin
#addin nuget:?package=NetDetector&version=0.0.3

// Install NetDetector as a Cake Tool
#tool nuget:?package=NetDetector&version=0.0.3                

NetDetector

NetDetector is a daemon which checks for and responds to a given MAC or IP address on the network.

Help text

> NetDetector  -h
Usage: NetDetector [-h] [-v] [-c CONNECT] [-d DISCONNECT] [-r RATE]
                   [-C CONNECT-COUNT] [-D DISCONNECT-COUNT]
                   [-i INTERFACE] ADDR
Positional arguments:
  ADDR
        The IP or MAC address to detect.
Optional arguments:
  -h, --help
        Displays this help message and exits.
  -v, --version
        Displays the version.
  -c CONNECT, --connect CONNECT
        The command to run when the MAC address is detected on the network.
  -d DISCONNECT, --disconnect DISCONNECT
        The command to run when the MAC address is no longer detected on the network.
  -r RATE, --rate RATE
        The poll rate in seconds.
        Default: 60
  -C CONNECT-COUNT, --connect-count CONNECT-COUNT
        The number of consecutive connection detections that must elapse before the
          connect command is run.
        Default: 1
  -D DISCONNECT-COUNT, --disconnect-count DISCONNECT-COUNT
        The number of consecutive disconnection detections that must elapse before
          the disconnect command is run.
        Default: 1
  -i INTERFACE, --interface INTERFACE
        The network interface to use as the scope identifier.
        Default: 1

Detection

test.sh

#!/bin/bash

cmd="$1"

if [ "$cmd" = "connect" ]
then
        echo "$NET_DETECTOR_ADDRESS detected"
elif [ "$cmd" = "disconnect" ]
then
        echo "$NET_DETECTOR_ADDRESS not detected"
fi

NetDetector

> NetDetector fe80::9c11:e50:ad4f:f749 -i eth2 -r 1 -c "./test.sh connect" -d "./test.sh disconnect"
(fe80::9c11:e50:ad4f:f749%3) - Watching
(fe80::9c11:e50:ad4f:f749%3) - Not detected
(fe80::9c11:e50:ad4f:f749%3) - Running: ./test.sh disconnect
fe80::9c11:e50:ad4f:f749%3 not detected
(fe80::9c11:e50:ad4f:f749%3) - Detected
(fe80::9c11:e50:ad4f:f749%3) - Running: ./test.sh connect
fe80::9c11:e50:ad4f:f749%3 detected
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.4 974 5/20/2018
0.0.3 853 5/20/2018
0.0.2 761 5/20/2018