J
J
jimmik2020-07-09 12:28:48
linux
jimmik, 2020-07-09 12:28:48

How can I make it so that when the script is interrupted, other settings are performed?

There is a sh script
At startup, the screen resolution changes to the desired one
The script is executed until it is interrupted by ctrl + c
but after interruption, of course, the resolution back is not applied
can someone tell me how to do it after pressing ctrl + c in the configuration script returned to original

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ronald McDonald, 2020-07-09
@jimmik

after pressing ctrl+c

Read: https://laurvas.ru/bash-trap/
Ctrl+C is SIGINT, process it with a trap.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question