Re: [Tails-dev] [Tails-project] boot tails iso with grub

Borrar esta mensaxe

Responder a esta mensaxe
Autor: intrigeri
Data:  
Para: linux-service, The Tails public development discussion list
Asunto: Re: [Tails-dev] [Tails-project] boot tails iso with grub
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