Auto login PTT with Expect

Required Tools

sudo apt-get install expect

Step

  1. Get ptt.sh

 sudo wget https://raw.github.com/carry0987/Raspberry-Pi-Repo/master/Expect/ptt.sh
  1. Set username & password

vim ptt.sh
  1. Give the script executing permission

    sudo chmod +x ptt.sh
  2. Move ptt.sh to usr folder

    sudo mv ptt.sh /usr/local/bin
  3. Now edit crontab to make the script run every minutes

    sudo vim /etc/crontab
  4. Add the following script on the bottom, then save and exit

    * 6 * * * root /usr/bin/expect /usr/local/bin/ptt.sh >/dev/null 2>&1
  5. Restart cron service

    sudo service cron restart
  6. Finish

Last updated