Skip to content

Instantly share code, notes, and snippets.

@robstradling
Created July 19, 2017 20:30
Show Gist options
  • Save robstradling/14c1a396495b38a5cbd076d679054ce2 to your computer and use it in GitHub Desktop.
Save robstradling/14c1a396495b38a5cbd076d679054ce2 to your computer and use it in GitHub Desktop.
Generate add-chain JSON (assume no chain is needed)
#!/bin/bash
echo -n "{\"chain\":[\""
INPUT_FILE=`mktemp`
echo $1 | sed "s/^/openssl base64 -d -in /g" | sed "s/$/ | base64 -w0/g" > $INPUT_FILE
chmod 755 $INPUT_FILE
$INPUT_FILE
rm $INPUT_FILE
echo "\"]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment