#!/bin/sh

# /etc/hotplug.d/button/00-button

if [ "$ACTION" = "pressed" ]; then
   if [ "$BUTTON" = "BTN_1" ]; then
      if [ $(ps | grep motion | wc -l) = 1 ]; then
         motion &
      else
         killall motion
      fi
   fi
fi



