When a user provided a malformed url or the server return a file "Not Found" error, the script continued to execute.
the --fail option passed to curl prevent this behavior and result in a proper error handling.
have a look at the following example:
./flash --hostname node01 https://github.com/hypriot/image-builder-rpi/releases/download/v1.4.0/hypriotos-rpi-v1.4.0.im
/usr/bin/curl
Downloading https://github.com/hypriot/image-builder-rpi/releases/download/v1.4.0/hypriotos-rpi-v1.4.0.im ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404 Not Found
When a user provided a malformed url or the server return a file "Not Found" error, the script continued to execute. the --fail option passed to curl prevent this behavior and result in a proper error handling.
have a look at the following example: