From 4552b7cb38117848718ac21ec424a44f741723ef Mon Sep 17 00:00:00 2001 From: sneak Date: Thu, 10 Jun 2021 16:36:28 -0700 Subject: [PATCH] make smarter --- prov.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/prov.sh b/prov.sh index ccfe91a..713d635 100644 --- a/prov.sh +++ b/prov.sh @@ -8,8 +8,23 @@ function main() { prov-$RELEASE } +function install-jq { + if which jq >/dev/null 2>&1 ; then + return + fi + apt install -y jq +} + +function install-curl { + if which curl >/dev/null 2>&1 ; then + return + fi + apt install -y curl +} + function detect-mirror-country() { - apt install -y jq curl + install-jq + install-curl curl ipinfo.io | jq -r .country } @@ -59,6 +74,10 @@ zstd } function install-age () { + if which age >/dev/null 2>&1 ; then + return + fi + cd /tmp git clone https://filippo.io/age && cd age go build -o . filippo.io/age/cmd/...