Jump to content

c_shutdown() for both master and slave


Recommended Posts

Make an alias in .bashrc or make an executable bash script with the three commands.

Here is an example of a .bashrc alias, with 3 servers.

Replace screen name DST01-03 with your screen name(s).

shutdownservers() {screen -S DST01 -X stuff 'echo c_shutdown()'$(echo -ne '\015') &&screen -S DST02 -X stuff 'echo c_shutdown()'$(echo -ne '\015') &&screen -S DST03 -X stuff 'echo c_shutdown()'$(echo -ne '\015') }

Example of a bash script.

#!/bin/bashscreen -S DST01 -X stuff 'echo c_shutdown()'$(echo -ne '\015') &&screen -S DST02 -X stuff 'echo c_shutdown()'$(echo -ne '\015') &&screen -S DST03 -X stuff 'echo c_shutdown()'$(echo -ne '\015')

Put it in a file and name it file.sh, and chmod +x file to make it able to run.

Run it: ./file.sh

 

 

Link to comment
Share on other sites

Make an alias in .bashrc or make an executable bash script with the three commands.

Here is an example of a .bashrc alias, with 3 servers.

Replace screen name DST01-03 with your screen name(s).

shutdownservers() {screen -S DST01 -X stuff 'echo c_shutdown()'$(echo -ne '\015') &&screen -S DST02 -X stuff 'echo c_shutdown()'$(echo -ne '\015') &&screen -S DST03 -X stuff 'echo c_shutdown()'$(echo -ne '\015') }

Example of a bash script.

#!/bin/bashscreen -S DST01 -X stuff 'echo c_shutdown()'$(echo -ne '\015') &&screen -S DST02 -X stuff 'echo c_shutdown()'$(echo -ne '\015') &&screen -S DST03 -X stuff 'echo c_shutdown()'$(echo -ne '\015')

Put it in a file and name it file.sh, and chmod +x file to make it able to run.

Run it: ./file.sh

Wait isn't that for Linux systems? I'm kinda new in this so it's hard for me to understand some things.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
×
  • Create New...