Created
May 31, 2018 08:37
-
-
Save jrha/f7fd2418435cd33abfa11312ad58244d to your computer and use it in GitHub Desktop.
aq showdeps & searchprofile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ "$#" -eq 2 ]]; then | |
showdeps $2 | xargs grep --color $1 | |
else | |
echo "Usage: searchprofile NEEDLE HOSTNAME" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ "$#" -eq 1 ]]; then | |
depfile="/var/quattor/build/$(jq -r .metadata.template.branch.name "/var/www/html/profiles/$1.json")/$1.dep" | |
if [[ -e $depfile ]]; then | |
awk '! /ABSENT_SOURCE/ {sub("^[^:]*:", "", $3); print $3$1($2!="TEXT"?"."tolower($2):"")}' $depfile | |
else | |
echo "$1 must have a valid pan dependency file" | |
fi | |
else | |
echo "Usage: showdeps HOSTNAME" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment