Skip to content

Instantly share code, notes, and snippets.

@shayelkin
Last active December 15, 2015 14:49
Show Gist options
  • Save shayelkin/5277066 to your computer and use it in GitHub Desktop.
Save shayelkin/5277066 to your computer and use it in GitHub Desktop.
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"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment