From 29defca4d5d4c701a6faa350a16ebab8361e0a84 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Wed, 20 May 2015 18:52:30 -0700 Subject: [PATCH] (Jonathan Bennett) added console-qr.sh script to create QR codes from fwknopd access.conf keys --- CREDITS | 2 ++ ChangeLog | 2 ++ extras/console-qr/console-qr.sh | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100755 extras/console-qr/console-qr.sh diff --git a/CREDITS b/CREDITS index 38e21083..c3d559b0 100644 --- a/CREDITS +++ b/CREDITS @@ -1,6 +1,8 @@ Jonathan Bennett - Contributed OpenWRT support - see the extras/openwrt/ directory. - Suggested the addition of the --key-gen option to fwknopd. + - Contributed the console-qr.sh script (in extras/console-qr/) to create + QR codes from fwknopd access.conf keys. Sebastien Jeanquier - Assisted with getting fwknop included in BackTrack Linux - the choice diff --git a/ChangeLog b/ChangeLog index 4daf008d..931dbeaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ fwknop-2.6.7 (05//2015): - Added --key-gen to fwknopd. This feature was suggested by Jonathan Bennett, and will help with ease of use efforts. The first platform to take advantage of this will likely be OpenWRT thanks to Jonathan. + - Added a script from Jonathan Bennett at extras/console-qr/console-qr.sh + to generate QR codes from fwknopd access.conf keys. fwknop-2.6.6 (04/23/2015): - [server] Add the ability for fwknopd to function as an generic SPA diff --git a/extras/console-qr/console-qr.sh b/extras/console-qr/console-qr.sh new file mode 100755 index 00000000..7c7dfbaa --- /dev/null +++ b/extras/console-qr/console-qr.sh @@ -0,0 +1,24 @@ +#!/bin/sh +while read line; do + line=$(echo "$line" | sed 's:#.*$::g') + if [ "$(echo $line | grep -c 'SOURCE')" -ne "0" ] + then + source=$line + if [ -n "$qr" ] + then + echo $'\n\n'$source + qrencode -o - -t UTF8 "$qr" + qr="" + fi + fi + if [ "$(echo $line | grep -c 'KEY')" -ne "0" ] + then + trline="$(echo $line | sed 's/^[ \t]*//;s/[ \t]*$//' | sed 's/ /:/')" + qr="$qr$trline " + fi +done +if [ -n "$qr" ] +then + echo $'\n\n'$source + qrencode -o - -t UTF8 "$qr" +fi