News for hackers. Stuff that matters.
Re:Ask HN: What's your favorite little script you've written? by reify on Friday July 04, 2025 @04:10AM (#44462317)
being an android AOSP user I had no way to download or check for updates for signal messenger.

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
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

===============================================

There are no comments on this comment yet.