Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Ask HN: What's your favorite little script you've written?.
writing this bash script at nearly 70 years old was like getting my first degree.
it took me ages.
download-signal-script.sh
signal is now available in the Guardian project repo.
===========================
#! /bin/bash
# save json output to read shasums
curl -s https://updates.signal.org/android/latest.json -o json.txt
# save url from json to file
curl -s https://updates.signal.org/android/latest.json | jq ".url" -r >signal.txt
# show url
cat json.txt | jq ".url" -r
# remove files if selcted no and ext
trap "rm -f json.txt signal.txt" EXIT
# ask to continue
while true
do
read -r -p 'Do you want to continue? ' choice case "$choice" in y|Y) break;; n|N) exit;; esac
# download new signal update
xargs -n 1 curl -O < signal.txt
# extract the sha256sum from the url or json file
# curl -s https://updates.signal.org/android/latest.json | jq ".sha256sum" -r
# check the files sha256sum
cat signal.txt | echo | sha256sum *.apk
# compare shasums
cat json.txt | jq ".sha256sum" -r
===============================================
There are no comments on this comment yet.
writing this bash script at nearly 70 years old was like getting my first degree.
it took me ages.
download-signal-script.sh
signal is now available in the Guardian project repo.
===========================
#! /bin/bash
# save json output to read shasums
curl -s https://updates.signal.org/android/latest.json -o json.txt
# save url from json to file
curl -s https://updates.signal.org/android/latest.json | jq ".url" -r >signal.txt
# show url
cat json.txt | jq ".url" -r
# remove files if selcted no and ext
trap "rm -f json.txt signal.txt" EXIT
# ask to continue
while true
do
done# download new signal update
xargs -n 1 curl -O < signal.txt
# extract the sha256sum from the url or json file
# curl -s https://updates.signal.org/android/latest.json | jq ".sha256sum" -r
# check the files sha256sum
cat signal.txt | echo | sha256sum *.apk
# compare shasums
cat json.txt | jq ".sha256sum" -r
===============================================