Automic Workload Automation

 View Only

  • 1.  encrypted passwords using &UC_JOBMD CMD - used in multi-line script?

    Posted Jan 28, 2016 07:32 PM
    Does anyone know if I can use the &UC_JOBMD CMD within a multi-line script ?

    We've moved the majority of our processing into docker containers. I'm providing templates that allow for users to create a set of shell commands that will all get sent to the docker container. I was wondering if I could pass an encrypted password from my PromptSet to that command.

    I've used the encypted password on a single line script
    &UC_JOBMD CMD="script.sh &USER# &PASS#"


    But now I want to use this type of command
    set -o errexit -o nounset -o pipefail

    cat << EndOfMessage | ${DOCKER_RUN} -i --name="${CONTAINER_NAME}" ${DOCKER_IMAGE} /bin/bash -s
    set -o errexit -o nounset -o pipefail
    !#####Please put your shell script below######
    !######Make sure you escape dollar sign $######

    VAR=SAMAH
    env
    new_script.sh &USER# &PASS# \$VAR

    !##############################################
    EndOfMessage


    I don't know if I need to put the &UC_JOBMD CMD around the whole text? Or if there is another way?

    Thanks
    Samah


  • 2.  encrypted passwords using &UC_JOBMD CMD - used in multi-line script?

    Posted Feb 01, 2016 09:36 PM
    I don't think the CMD can handle multiple lines, but you could set it to an OS variable and then call the OS in multi=line script.


  • 3.  RE: encrypted passwords using &UC_JOBMD CMD - used in multi-line script?

    Posted Nov 20, 2024 10:26 AM

    Here's how you would do it 

    set -o errexit -o nounset -o pipefail
    
    cat << EndOfMessage | ${DOCKER_RUN} -i --name="${CONTAINER_NAME}" ${DOCKER_IMAGE} /bin/bash -s
    set -o errexit -o nounset -o pipefail
    !#####Please put your shell script below######
    !######Make sure you escape dollar sign $######
    
    VAR=SAMAH
    env
    &UC_JOBMD CMD="new_script.sh &USER# &PASS# \$VAR"
    
    !##############################################
    EndOfMessage