-
-
Save Achieve777/5e02b951ad9a7703f8451a4c900cc87c to your computer and use it in GitHub Desktop.
自动获取验证码
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 | |
result=$(sqlite3 ~/Library/Messages/chat.db 'SELECT text FROM message WHERE datetime(date/1000000000 + 978307200,"unixepoch","localtime") > datetime("now","localtime","-60 second") ORDER BY date DESC LIMIT 1;') | |
name="验证码"; | |
if [ ! $result ]; then | |
echo "latest not receive code messsages"; | |
fi | |
if [[ "$result" =~ "$name" ]]; then | |
code=`echo $result | grep -o "\d\{4,6\}"`; | |
echo -n "$code"; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment