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 210 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 $$

Kondybas
- 6,964
- 2
- 20
- 24