This project demonstrates how to implement graceful shutdown in Bash using signal handling (trap) and cleanup functions.
- The script writes a timestamp to
/tmp/graceful.stateevery 5 seconds. - When Ctrl-C is pressed, it deletes the temp file and exits cleanly.
./scripts/graceful.sh Press ⇧ Ctrl-C to see cleanup.