as title says I have a centOS 6 machine which uses an dracut, initramfs preboot ssh. I want to create a shell script that at the end of it's execution it closes the console and ssh connection. How can I do that. Escape character ~. does not work.
Asked
Active
Viewed 207 times
1 Answers
0
You have to determine PID of shell started after SSH-session has been established - and kill it. SSH session terminates automatically. Most shells has variable $$ that contains PID of parent shell. So just add to your script last line:
kill -6 $$
![](../../users/profiles/110736.webp)
Kondybas
- 6,864
- 2
- 19
- 24