====== Set configuration setting from download contents ====== ===== Synopsis ===== imgset [--timeout ] [--keep] ===== Examples ===== === Get the latest iPXE version number === imgset latest https://boot.ipxe.org/version.txt show latest === Obtain an AWS IMDSv2 authentication token === params --method PUT param --header X-Aws-Ec2-Metadata-Token-Ttl-Seconds 600 imgset authtoken http://169.254.169.254/latest/api/token##params ===== Description ===== Download an image from the specified URI, and set the value of the configuration [[:settings|setting]] to the downloaded image contents. A download progress timeout can be specified (in milliseconds) using the ''%%--timeout%%'' option. The downloaded image will be discarded after setting the value of the configuration setting unless the ''%%--keep%%'' option is specified. ===== Command status ===== ^ Success | The configuration setting was downloaded and applied successfully | ^ Failure | The configuration setting was not downloaded and applied successfully | ===== See also ===== * ''[[:cmd:imgfetch]]'' * ''[[:cmd:set]]'' * ''[[:cmd:show]]'' * [[:cfg|List of all iPXE settings]] * [[:cmd|List of all iPXE commands]] ===== Notes ===== If you are fetching values from an HTTP API then you may need to use the ''[[:cmd:param]]'' command to specify custom headers (e.g. for authentication). The configuration setting value will be set to the raw byte value of the downloaded image contents. If you specify a [[:settings#types|setting type]] as part of the setting name, then this will be used when subsequently interpreting the raw byte value. For example: iPXE> imgset latest https://boot.ipxe.org/version.txt https://boot.ipxe.org/version.txt...ok iPXE> show latest latest:string = 2.0.0+ (g91758) iPXE> imgset latest:hex https://boot.ipxe.org/version.txt https://boot.ipxe.org/version.txt... ok iPXE> show latest latest:hex = 32:2e:30:2e:30:2b:20:28:67:39:31:37:35:38:29:0a If you have an HTTP endpoint that returns a numeric value as a string, you will therefore need to use two commands to obtain this as a numeric setting within iPXE. For example: iPXE> imgset count http://192.168.0.1/api/count iPXE> set count:int32 ${count} iPXE> show count count:int32 = 42 iPXE> inc count iPXE> show count count:int32 = 43