From 15dc9ae46b5927c9bc37e826b3ba58e3e5a52d67 Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Wed, 18 Apr 2018 19:04:10 -0400 Subject: [PATCH] Handle new 12-byte IV format in openbrowser.sh --- openbrowser.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openbrowser.sh b/openbrowser.sh index 3e32c1d..5b94615 100755 --- a/openbrowser.sh +++ b/openbrowser.sh @@ -1,12 +1,16 @@ #!/bin/bash +#exec firefox "$@" set -e URL=$1 BROWSER=xdg-open +BROWSER=firefox AES_GCM="$(dirname $(readlink -f $0))/aesgcm" -if [ ${URL: -97:1} == "#" ] +if [ ${URL: -97:1} == "#" -o ${URL: -89:1} == "#" ] then [ -e "$AES_GCM" ] || gcc "$(dirname $(readlink -f $0))/aesgcm.c" -lcrypto -o "$AES_GCM" - curl "$URL" | "$AES_GCM" "${URL: -96}" | feh -. - + iv_key="$(echo "$URL" | sed 's/^.*#//')" + URL="$(echo "$URL" | sed 's/^aesgcm/https/')" + curl "$URL" | "$AES_GCM" "$iv_key" | feh -. - elif echo $URL | grep -i '\.pgp$' then curl "$URL" | gpg2 -d | feh -. -