Added logic to run the shutdown scripts

Shutdown script works on Debian 7