From b867c5dc0097b09a75705d616cc10f65c3d60ffb Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 23 Dec 2022 12:07:30 +0100 Subject: knot pdb --- bin/age | 41 +++++++++++++++++++++++++++++++++++++++++ bin/age-keygen | 1 + bin/sops | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100755 bin/age create mode 120000 bin/age-keygen create mode 100755 bin/sops (limited to 'bin') diff --git a/bin/age b/bin/age new file mode 100755 index 0000000..d0d4eef --- /dev/null +++ b/bin/age @@ -0,0 +1,41 @@ +#!/bin/bash + +set -euo pipefail + +v=1.0.0 + +basedir="${0%/*}" +self="${0##*/}" + +s=$(uname -s) +case "$s" +in + Darwin) s=darwin ;; + Linux) s=linux ;; + *) echo "Unsupported system: $s" >/dev/stderr; exit 1 ;; +esac + +m=$(uname -m) +case "$m" +in + x86_64) m=amd64 ;; + arm64) ;; + *) echo "Unsupported machine: $m" >/dev/stderr; exit 1 ;; +esac + +url=https://github.com/FiloSottile/age/releases/download/v${v}/age-v${v}-${s}-${m}.tar.gz + +tar="$basedir/.age/age-${v}.tar.gz" +bin="${tar%.tar.gz}/age/$self" + +if [[ ! -x "$bin" ]] +then + mkdir -p "${tar%/*}" + wget -O "$tar" "$url" + + mkdir -p "${tar%.tar.gz}" + tar xf "$tar" -C "${tar%.tar.gz}" + chmod +x "$bin" +fi + +exec "$bin" "${@}" diff --git a/bin/age-keygen b/bin/age-keygen new file mode 120000 index 0000000..41a3b6d --- /dev/null +++ b/bin/age-keygen @@ -0,0 +1 @@ +age \ No newline at end of file diff --git a/bin/sops b/bin/sops new file mode 100755 index 0000000..89bb750 --- /dev/null +++ b/bin/sops @@ -0,0 +1,35 @@ +#!/bin/bash + +v=3.7.3 + +basedir="${0%/*}" +self="${0##*/}" + +s=$(uname -s) +case "$s" +in + Darwin) s=darwin ;; + Linux) s=linux ;; + *) echo "Unsupported system: $s" >/dev/stderr ;; +esac + +m=$(uname -m) +case "$m" +in + x86_64) m=amd64 ;; + arm64) ;; + *) echo "Unsupported machine: $m" >/dev/stderr ;; +esac + +url=https://github.com/mozilla/sops/releases/download/v${v}/sops-v${v}.$s.$m + +bin="$basedir/.$self/$self-$v" + +if [[ ! -x "$bin" ]] +then + mkdir -p $(dirname "$bin") + wget -O "$bin" "$url" + chmod +x "$bin" +fi + +exec "$bin" "${@}" -- cgit v1.2.3