You should modify the ~/.bash_logout file in order to run the script upon logout.
What is script?
Script is a written text of a play, film, or broadcast. It’s a blueprint for a production, containing all of the dialogue, directions, and stage directions. A script is typically written by a screenwriter, although it is sometimes written by the director or producer. It is the basis for all of the action in a movie, television show, play, or radio production. Scripts come in many different forms, including stage plays, teleplays, and documentary scripts. They can range from very brief outlines to full-length manuscripts. Scripts are essential for any production, as they provide the roadmap for the entire production process.
To learn more about script
https://brainly.com/question/26165623
#SPJ1