Skip to content

Instantly share code, notes, and snippets.

View mnemesh-pivotal's full-sized avatar

Mike mnemesh-pivotal

  • VMware
View GitHub Profile
@mnemesh-pivotal
mnemesh-pivotal / get_pivnet_sw.sh
Last active June 22, 2016 14:55
New version which uses jq to work with the json data instead of grep/awk/sed/etc
#!/bin/bash
[ "$1" = "-d" ] && debug=on || debug=off
for i in curl wget jq; do
if [ $(which ${i} > /dev/null 2>&1) ]
then
printf "\n%s requires the ${i} command line utility. Exiting...\n" $(basename $0)
exit 0
fi
done
@mnemesh-pivotal
mnemesh-pivotal / get_piv_sw.sh
Last active June 21, 2016 15:26
Interactive script for downloading software from network.pivotal.io using the download API. I have created a newer version at https://gist.github.com/mnemesh-pivotal/940d4358e421fd19caad42d03a1af7c3. It uses jq instead of sed/awk/grep/tac/etc to gather information from the the json files.
#!/bin/bash
[ "$1" = "-d" ] && debug=on || debug=off
# Make working directory
export wrkdir=/tmp/wrkdir.$$
mkdir -p ${wrkdir}
# Clean up function
clean_up()
{