On 11.11.2021 12:36, Federico Vaga wrote:
> Hello,
> 
> I'm trying to get the hostname in `grub.cfg` to point then to
> different rootnfs, or network live images.
> 
> From the manual page:
> 
> https://www.gnu.org/software/grub/manual/grub/grub.html
> 
> I've noticed the existence of `net_<interface>_hostname` but this
> requires to know the `<interface>` name in advance and this is
> platform dependent (as the documentation says).
> 
> Since these systems have only one network connection I thought about
> using `net_default_interface` to ignore the specific name. Here
> problems strarts because neasting variables seems not working and
> doing: `${net_${net_default_interface}_hostname}`
> 

eval "set myhostname=\${net_${net_default_interface}_hostname}"

and use $myhostname in following code

> However, in the documentation variables like `net_default_ip` are
> described as the result of ‘net_${net_default_interface}_ip’.
> 
> Am I doing something wrong? Do you have any suggestion?
> 
> Thanks
> 


Reply via email to