Skip to content

Instantly share code, notes, and snippets.

@jrha
Created May 31, 2018 08:37
Show Gist options
  • Save jrha/f7fd2418435cd33abfa11312ad58244d to your computer and use it in GitHub Desktop.
Save jrha/f7fd2418435cd33abfa11312ad58244d to your computer and use it in GitHub Desktop.
aq showdeps & searchprofile
#!/bin/bash
if [[ "$#" -eq 2 ]]; then
showdeps $2 | xargs grep --color $1
else
echo "Usage: searchprofile NEEDLE HOSTNAME"
fi
#!/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