Shell script to stop and start server

Hi,
I need to create a shell script for automated server patching, with the following scenario:

  1. I have two Linux servers Primary and secondary.
  2. Server patching should start on Primary 1st and then secondary.
    [list]
  3. 1st check both servers are up and running.
  4. Then stop primary and patching will start.
  5. Start primary after patching.
  6. Wait for server status to be running and check for messages ready in logs.
    [/list]
  7. Then stop the secondary side.
    [list]
  8. start patching.
  9. start the secondary server after patching is completed.
  10. Wait for server status to be running and check for messages ready in logs.
    [/list]
  11. I want to use uc4 to create jobs for this in later

Welcome!

Please post the shell scripts you have written so far.

Thanks.