Skip to content

Instantly share code, notes, and snippets.

View shayelkin's full-sized avatar

Shay Elkin shayelkin

View GitHub Profile
@shayelkin
shayelkin / take-timed-photo.sh
Last active December 15, 2015 14:49
Take a photo from webcam when connected to a wifi network with a given SSID. Combine with cron to have your picture taken every N minutes.
#!/bin/sh
allowed_ssid="everything"
capture_path="$HOME/captures"
# only take a photo when at work (connected to work network)
check_wireless=$(/sbin/iwconfig wlan0 | grep "ESSID:\"$allowed_ssid\"")
if [ -n "$check_wireless" ]; then
streamer -s 1280x720 -f jpeg -o "$capture_path/$(date +%Y%m%d.%H%M).jpeg"