capture linux halt or shutdown event code example Example: write a script to shutdown at a time in linux shutdown -h 21:45