Last active
December 15, 2015 03:58
-
-
Save niyaton/5197741 to your computer and use it in GitHub Desktop.
VNCのスクリーンショットを変化があった時だけ作成するスクリプト.cronに仕込んで使う.
This file contains 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 - | |
new_filename=`date +\%Y\%m\%d\%H\%M\%S`.jpg | |
old_filename=`ls *.jpg | tail -n 1` | |
old_md5=`md5sum $old_filename | cut -d ' ' -f 1` | |
DISPLAY=":1.0" import -w root $new_filename | |
new_md5=`md5sum $new_filename | cut -d ' ' -f 1` | |
if [ $old_md5 = $new_md5 ]; then | |
rm $new_filename | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment