Created
May 20, 2025 03:53
-
-
Save ryukinix/4e4259028002d05fbbad0c574c86c082 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# dump screenshots to telegram and delete from filesystem | |
set -e | |
get-pictures() { | |
# get screenshots | |
find /mnt/mmc/Roms /mnt/sdcard/Roms -type f -regex ".*-[0-9]+-[0-9]+.png\$" | |
} | |
send-pic() { | |
# send to telegram | |
local fpath="$1" | |
local fname=`basename "$fpath"` | |
telegram-owl -m "$fname" -a "$fpath" | |
} | |
delete-pic() { | |
# delete from filesystem | |
local fpath="$1" | |
rm -rfv "$fpath" | |
} | |
main() { | |
get-pictures | while read pic; do | |
send-pic "$pic" | |
delete-pic "$pic" | |
done | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment