Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Stop script execution example with "rsh":

Image Added

Include Page
KBCOMMON:DOC-GoToToc
KBCOMMON:DOC-GoToToc

...

Display output example from the "vmlist" command:

...Image Added


Script example:

(lightbulb) In this example, we 'll use "ssh" to display the guest "uptime" and the result of the "uname -nr" command (name of the node + release number of the operating system)

(warning) The last 2 lines containing the RETVAL variable are mandatory

...

classcommandline

...

To create the script, the following commands were executed to copy the provided example to the one that will be used:

# cp /opt/charon/utils/charon_gstart.chkrun

# chmod 744

.example /opt/charon/utils/charon_gstart.chkrun

# vim /opt/charon/utils/charon_gstart.chkrun

#

!/bin/sh

#

# Parameter $1: contains full path to cfg file

#

case "$1"

in

  /charon/pluto.cfg)

    ssh -o ConnectTimeout=2 pluto "uptime|cut -f1 -d',';echo ' - ';uname -nr" 2>/dev/null

    RETVAL=$?

    ;;

  *)

    echo "Invalid parameter '$1'"

    RETVAL=1

    ;;

esac

echo "==RETVAL=${RETVAL}=="

exit ${RETVAL}

chmod 744 /opt/charon/utils/charon_gstart.chkrun

Image Added


Example file provided (contains example for Tru64 and OpenVMS):

...

Include Page
KBCOMMON:DOC-GoToToc
KBCOMMON:DOC-GoToToc

...