Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
executable file 24 lines (20 sloc) 486 Bytes
#!/bin/bash
function require(){
PROGRAM="$1"
ALTERNATIVE="$2"
if command -v $PROGRAM >/dev/null 2>&1; then
echo $PROGRAM
return
else
if command -v $ALTERNATIVE >/dev/null 2>&1; then
echo $ALTERNATIVE;
else
echo "Missing required program: $PROGRAM"
exit 1
fi
fi
}
VAULT=$(require vault)
COPY=$(require pbcopy "xsel -b")
SERVICE=${1:? "Usage: $0 SERVICE_NAME"}
$VAULT -p $SERVICE | $COPY
You can’t perform that action at this time.