I know you can run a program in a detached screen, but I would log into an existing screen, kill the currently running process, restart it and then detach.
Is it possible to do that with a bash script, how can I send ctrl-A ctrl-D and Ctrl-C for instance?
expect
, but there might be screen options that are easier to use than sending keystrokes