Adding timing to push-button

A project log for Smart Intercom

Real-Time system that allow to pass only authorized/invited people, using Face-Recognition or NFC cards.

EvgheniiEvghenii 09/12/2017 at 12:150 Comments

In order to disable entrance in specific hours via push-button, i made the following  bash script:


H=$(date +%H)
if (( 7 <= 10#$H && 10#$H < 19 )); then 
    echo between 7AM and 19PM
sh /home/pi/
elif (( 19 <= 10#$H && 10#$H < 7 )); then 
    echo between 19PM and 7AM
sh /home/pi/
    echo go to bed
fi - opens the door between 7 am and 19 pm - displays restriction image between 19 pm and 7 am script

DISPLAY=:0.0 XAUTHORITY=/home/pi/.Xauthority /usr/bin/feh --hide-pointer -x -q -D 5 -B black -F /home/pi/error.png &
ping -c 4 localhost 2>/dev/null
DISPLAY=:0.0 XAUTHORITY=/home/pi/.Xauthority xdotool key "x"

P.S to run this script you will need to install xdotool

sudo apt install xdotool