Deploy a command for Liux server through BigFix

Hi,

I need to push two commands on Linux servers through BigFix. Can anyone suggest me how to do so or is this possible through BigFix or not, because I can see distribution wizard does not contain Linux option.
commands:
1. export CLOUDAMIZE_CUSTOMER_KEY=<key>
2. sh <(curl -s https://.....<file.sh>)

Thanks in advance!!

in the actionscript, you can use:

WAIT “/bin/bash” -c export…

Or

WAIT /bin/sh/

How the fixlet will be applicable for Linux servers?

You can make it a task, and just use TRUE in the relevance. Or you can just target linux systems by using:

name of operating system as lowercase contains “linux”

I have used below command but it is not installing on server

wait /bin/bash -c export CLOUDAMIZE_CUSTOMER_KEY="key"
wait /bin/sh -c <(curl -s htts://…installCloudamizeAgentV2.sh)

tried this also:

wait sudo /bin/bash -c export CLOUDAMIZE_CUSTOMER_KEY="key"
wait sudo /bin/sh -c sh <(curl -s https://…installCloudamizeAgentV2.sh

tried this also:

wait /bin/bash -c export CLOUDAMIZE_CUSTOMER_KEY=key
wait wget https://…installCloudamizeAgentV2.sh

nothing worked.

I’d not call myself a Linux admin, but I do question whether, having exported CLOUDAMIZE_CUSTOMER_KEY whether it is available to the following command - the next command is not a child of the command that did the export, it is a sibling.

I agree, these are two shells running with two different environments, so the variable set in the first would not be available to the second.

Try building and executing a single script that performs both pieces.

delete __createfile
createfile until END_OF_CREATE_FILE
#!/bin/sh
export CLOUDAMIZE_CUSTOMER_KEY="key"
/bin/sh <(curl -s https://…installCloudamizeAgentV2.sh)
END_OF_CREATE_FILE

delete my_script.sh
move __createfile my_script.sh
wait chmod +x my_script.sh
wait /bin/bash --login -c "./my_script.sh > '/tmp/script_output.txt' 2>&1"

I tried to harcode the key value in .sh file and ran below script.

wait mkdir /tmp/BigFix/
prefetch 7de8daa1fb10a06b8031e8caab83838084a86c36 sha1:7de8daa1fb10a06b8031e8caab83838084a86c36 size:4686 http://bfx2.mot.com:52311/Uploads/7de8daa1fb10a06b8031e8caab83838084a86c36/installCloudamizeAgentV2.sh.tmp sha256:4c1b9b33ee6e818fc576e7616662bd2287c0e4519020817a0b7c931c42d814e8
extract 7de8daa1fb10a06b8031e8caab83838084a86c36 "/tmp/BigFix/"
wait chmod 755 /tmp/BigFix
wait chmod 755 /tmp/BigFix/installCloudamizeAgentV2.sh
wait /bin/sh -c /tmp/BigFix/installCloudamizeAgentV2.sh

It doesn’t install anything and I got exit code 1.

any help will be great.
Thank you.

Thank you JasonWalker,

I have tried this script but no luck and I got exit code 2.

Does the script work, outside of BigFix?

We only have to run below two commands and when these commands are running on linux server they are working fine,

export CLOUDAMIZE_CUSTOMER_KEY=KEY
sh <(curl -s https:…manager1.cloudamize.com/cxf/downloadFile/installCloudamizeAgentV2.sh)

I am not aware of how to deploy these commands through BigFix console.

My version should have created an output log at /tmp/script_output.txt , was that file get created and if so what is in it?

I’m wondering if it depends on some user-environment variables like pathnames or proxy settings.

I did find an error in my action and corrected it above.

The ‘chmod’ statement should have been a ‘wait chmod’

error

this error I am getting with exit code 2 in BigFix console.

Yeah I wasn’t sure about the syntax of using those parentheses inside of a shell script. I don’t think the problem here is BigFix itself, but the syntax of the shell script you’re generating.

Is it maybe a difference in which shell is being called (/bin/bash vs /bin/sh vs whatever your login shell is that you’re using to test)?
Even if /bin/sh is a symlink to /bin/bash, bash will use some different syntaxes if it’s being called via the ‘/bin/sh’ name; and in some operating systems, /bin/sh is not Bash at all (i.e. it’s ‘dash’ on Ubuntu)