| die letzten Änderungen * Seitenstruktur * Stichwortsuche :


logo_puschin.jpg

Startseite

Knowledge base



Kontakt

Impressum

Startseite - Amazon Dash-Button - Button-Klick erkennen und Aktion ausführen

Amazon Dash-Button - Button-Klick erkennen und Aktion ausführen

4 Benutzer online Druckversion

ein Thema nach oben



Voraussetzung ist, dass dieses Skript auf dem DHCP-Server läuft.

Achtung:
Man sollte die Einrichtung des Buttons vor der Auswahl des Produktes abbrechen und ihm generell den Zugang zum Internet verwehren (z.B. via Kindersicherung).

Skript /usr/local/bin/dash_button.sh:


#!/bin/bash                                                                                                                                                                             
                                                                                                                                                                                        
if [ "$1" == "" ]; then                                                                                                                                                                 
<------>#tcpdump -l -i eth1 -n host 192.168.179.201 | /usr/local/bin/dash_button.sh foo                                                                                                 
<------>tcpdump -l -i eth1 -n '((port 67 or port 68) and (udp[8:1] = 0x1))' | /usr/local/bin/dash_button.sh foo                                                                         
<------>exit 0                                                                                                                                                                          
fi                                                                                                                                                                                      
                                                                                                                                                                                        
while read zeile                                                                                                                                                                        
do                                                                                                                                                                                      
                                                                                                                                                                                        
    #echo "--> $zeile"                                                                                                                                                                  
                                                                                                                                                                                        
    DHCP_REQUEST=`echo $zeile | grep "BOOTP/DHCP"`                                                                                                                                      
    MAC=`echo $zeile | awk -F "Request from " '{ print $2 }' | cut -d"," -f1`                                                                                                           
                                                                                                                                                                                        
    echo "$DHCP_REQUEST: $MAC"                                                                                                                                                          
                                                                                                                                                                                        
    # Dash-Button 1                                                                                                                                                                     
    #                                                                                                                                                                                   
    if [ "$MAC" == "50:f5:da:08:e0:57" ]; then                                                                                                                                          
                                                                                                                                                                                        
<------>echo "BUUUUUUUUUUUUUUUUUUUM!"                                                                                                                                                   
                                                                                                                                                                                        
    fi                                                                                                                                                                                  
                                                                                                                                                                                        
done < /dev/stdin                                                                                                                                                                       
                                     


Amazon Dash-Button - Button-Klick erkennen und Aktion ausführen wurde zuletzt bearbeitet am 04.09.16 durch Frank

www.puschin.de
login

<body bgcolor='#FFFFFF' link='#000000' vlink='#000000' alink='#000000' text='#000000'><font face='Verdana' size='2'><strong>www.puschin.de</strong><br>Die Webseite http://www.puschin.de bietet eine interessante Webseite zu vielen Themen aus dem Bereich Linux und Windows. Man findet hier Tipps und Tricks zu cms php apache postfix openxchange tomcat windows linux firewall <br><br><font face='Verdana' size='2'><li><a href='cms.php?print=&aktion=thema_anzeigen&menue_id=191'>Startseite</a><font face='Verdana' size='2'><li><a href='cms.php?print=&aktion=thema_anzeigen&menue_id=63'>Knowledge base</a><font face='Verdana' size='2'><li><a href='cms.php?print=&aktion=thema_anzeigen&menue_id=57'>Kontakt</a><font face='Verdana' size='2'><li><a href='cms.php?print=&aktion=thema_anzeigen&menue_id=9'>Impressum</a></body>