57 lines
2.2 KiB
Bash
57 lines
2.2 KiB
Bash
#!/bin/bash
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
# install postgrest / frode klevstul / oct 2025
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
|
|
if [ "$EUID" -ne 0 ]
|
|
then echo "error: run as 'root'"
|
|
exit
|
|
fi
|
|
|
|
# ---
|
|
# postgrest
|
|
# ---
|
|
|
|
# https://gist.github.com/steinwaywhw/a4cd19cda655b8249d908261a62687f8
|
|
|
|
#wget https://github.com/PostgREST/postgrest/releases/latest/download/postgrest-linux-amd64
|
|
|
|
#https://github.com/PostgREST/postgrest/releases/latest/download/postgrest-latest-linux-static-x86-64.tar.xz
|
|
|
|
|
|
#https://github.com/PostgREST/postgrest/releases/download/v14.0/postgrest-v14.0-linux-static-x86-64.tar.xz
|
|
|
|
|
|
#wget -qO- --max-redirect=10 https://github.com/PostgREST/postgrest/releases | grep -wo "https.*x86_64.deb\|https.*amd64.deb" | head -n 1 | xargs -I {} wget -O test.deb {}
|
|
|
|
cd /tmp
|
|
|
|
#curl -s https://api.github.com/repos/PostgREST/postgrest/releases/latest | sed 's/[()",{}]/ /g; s/ /\n/g' | grep "https.*releases/download*static*.*tar.xz"
|
|
|
|
#curl -L -o dotenvx.tar.gz "https://github.com/dotenvx/dotenvx/releases/latest/download/dotenvx-$(uname -s)-$(uname -m).tar.gz"
|
|
|
|
#wget -qO- 'https://api.github.com/repos/<REPO>/releases/latest' | jq -r '.assets[] | select(.name | match("tar.(gz|xz)")) | .browser_download_url' | xargs wget -qO- | bsdtar -xf -
|
|
|
|
#wget -qO- 'https://api.github.com/repos/PostgREST/postgrest/releases/latest' | jq -r '.assets[] | select(.name | match("tar.(gz|xz)")) | .browser_download_url' | xargs wget -qO-
|
|
|
|
|
|
|
|
# src: https://gist.github.com/steinwaywhw/a4cd19cda655b8249d908261a62687f8?permalink_comment_id=5097031#gistcomment-5097031
|
|
|
|
# Fetch the latest release version
|
|
latest_version=$(curl -s https://api.github.com/repos/PostgREST/postgrest/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')
|
|
|
|
# Remove the 'v' prefix from the version number
|
|
#version=${latest_version#v}
|
|
|
|
# Construct the download URL
|
|
download_url="https://github.com/PostgREST/postgrest/releases/download/${latest_version}/postgrest-${latest_version}-linux-static-x86-64.tar.xz"
|
|
|
|
wget -O postgrest.tar.xz ${download_url}
|
|
|
|
# Download the tar.gz file
|
|
#curl -L -o "js-debug-dap-${version}.tar.gz" "$download_url"
|
|
|