linux-service: > so if i: > #!/bin/bash > url=`curl > 'https://tails.boum.org/install/v2/Tails/amd64/stable/latest.json' | awk > -F'"' '{ for(i=1; i<=NF; i++) { if($i ~ /^http/) print $i } } '` > wget $url
> i always get the latest iso? That's the idea :) Now, "parsing" JSON this way feels super fragile. If you have to stick to shell, I recommend using jq(1) to extract the info you want. But really, switching to Python / Ruby / etc. would be nicer (and then you won't have to deal with the "shell programming is hard" problem, which your example script shows — e.g. missing quotes may lead to arbitrary code execution as root on all your users' systems, if our latest.json ever had malicious content). Cheers, -- intrigeri _______________________________________________ Tails-dev mailing list Tails-dev@boum.org https://www.autistici.org/mailman/listinfo/tails-dev To unsubscribe from this list, send an empty email to tails-dev-unsubscr...@boum.org.