Belkin Wemo plug & shellscript automated control

A client who uses paxton door access control for their gym wanted to have their TV switch on when a customer enters, and switch off after 1 hour. I bought a Belkin WeMo Switch and found a shellscript that can switch the wemo on and off (original script.)

For this I created a C# console application in combination with the paxton sdk that fetches the last time a user entered the premises, and it will write the desired state of the TV power switch to a simple txt file (ON or OFF):

This application is scheduled every few minutes, after wich a shell script is  called that will switch the tv to the desired state, the shellscript: