cloudcaptainsh / cloudcaptain

Issue Tracker for CloudCaptain
13 stars 3 forks source link

Allow boxfuse ls (or any command) be useable by shell scripts #176

Open little-vista-dev opened 7 years ago

little-vista-dev commented 7 years ago

We sometimes use shell scripts to perform more complex deployments. It would be really sweet if we could determine whether a boxfuse command like ls or ps was successful in listing a specific instance or application type

For example

#!/bin/sh

boxfuse ls myapp:1.1.0 || ... run a different command...

At the moment, boxfuse ls (or ps) returns successfully regardless of whether the instance is locally/vault available or not. To see what I mean type this on the command line (linux/mac) boxfuse ls non-existent-app || echo "Alternative"

or even..

boxfuse ls existing-app:not-available-version || echo "Alternative"

axelfontaine commented 7 years ago

You can also simply use grep for this. See https://stackoverflow.com/questions/16931244/checking-if-output-of-a-command-contains-a-certain-string-in-a-shell-script