-- Leo's gemini proxy
-- Connecting to szczezuja.flounder.online:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini; charset=utf-8
If somebody want to save time, you write a automating script in Bash. You shouldn't wonder if writing scripts is more time consuming, because it's Sunday afternoon. So I have written bash script for updating [GTL: Gemini Tiny Logs].
What this script is doing?
Check the last version of gtl on GitHub
Check the last version of gtl installed in current directory
Download a new version from GitHub to current directory
Do chmode +x for a new version file
Do ln ~/.local/bin/gtl for a new version file
2021-07-25 Update - Source code moved to [repository].
#!/bin/bash last_available=$(curl -s https://github.com/bacardi55/gtl/releases | grep "<a href=\"/bacardi55/gtl/releases/download/" | grep "amd64" | sort -ir | head -n 1 | egrep -o '"[^ ]+"' | head -n 1 | sed 's/"//g') echo "Last available = ${last_available}" if [ -z "$last_available" ] then echo "Empty response form GitHub!" exit fi last_installed=$(ls | egrep "(gtl).*(amd64)" | sort -ir | head -n 1 | sed 's/amd64//g' | sed 's/[a-z_]*//g') echo "Last installed = ${last_installed}" if [ -z "$last_installed" ] then echo "No version installed." exit fi if [[ "$last_available" == *"$last_installed"* ]]; then echo "No new version available." exit fi url="https://github.com/${last_available}" filename=$(basename $url) echo "Installing a new version from $url" wget "$url" && chmod +x "$filename" rm ~/.local/bin/gtl ln -s "$PWD"/"$filename" ~/.local/bin/gtl
--
szczezuja.space CC BY-SA
@ Sun 11 Jul 2021 04:59:25 PM CEST
tags: #bash, #tinylog, #gtl, #script
-- Response ended
-- Page fetched on Thu May 9 21:56:21 2024