Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- while test $# -gt 0; do
- case "$1" in
- -camera)
- shift
- camera=$1
- shift
- ;;
- -silent)
- shift
- silent=$1
- shift
- ;;
- -message)
- shift
- message=$1
- shift
- ;;
- *)
- echo "$1 is not a recognized flag!"
- return 1;
- ;;
- esac
- done
- TelegramBotToken=
- Chatid=
- SnapFile="/var/tmp/camsnapshot.jpg"
- wget -O $SnapFile "http://192.168.2.1:80/camsnapshot.jpg?idx="$camera""
- # Send Telegram message with image
- curl -s -X POST "https://api.telegram.org/bot"$TelegramBotToken"/sendPhoto" -F chat_id=$Chatid -F photo="@$SnapFile" -F disable_notification=$silent -F caption="$message" -F parse_mode="Markdown"
- # Remove Image
- /bin/rm $SnapFile
Advertisement
Add Comment
Please, Sign In to add comment