Last active
August 29, 2024 08:52
-
-
Save tonytonyjan/872126cb231af0a3e17b to your computer and use it in GitHub Desktop.
PTT 每天自動登入 / PTT automatically login
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
#!/usr/local/bin/expect -f | |
set timeout 60 | |
log_file -noappend $env(HOME)/log/ptt.log | |
spawn ssh -o "StrictHostKeyChecking no" [email protected] | |
expect "new" | |
send "$env(PTT_ID)\r" | |
expect ":" | |
send "$env(PTT_PWD)\r" | |
expect { | |
"您想刪除其他重複登入的連線嗎" { | |
send "n\r" | |
exp_continue | |
} | |
"請按任意鍵繼續" { | |
send "\r" | |
exp_continue | |
} | |
"批踢踢實業坊" { | |
exit | |
} | |
} |
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
6 6 * * * LC_ALL=zh_TW.Big5 PTT_ID=ID PTT_PWD=PWD PATH/TO/ptt.tcl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
想請問這個要怎麼使用?