Turn a Windows PC on or off with your Raspberry Pi

  • This is the bash script for the Raspberry Pi that I showed in this video:

    if [ "$1" == "off" ]
      echo turn computer $1 >> /tmp/computer_on_off.log
      /usr/local/bin/tcmd --trigger "Shutdown now" --computer DS
      echo turn computer $1 >> /tmp/computer_on_off.log
      wakeonlan C4:65:16:2B:95:97

    You can download the tcmd utility from here.

    To easily install the Raspberry Pi OS and the TRIGGERcmd agent, I recommend the setup.bat script you can get here.

Log in to reply