Skip to content
Snippets Groups Projects
50-set-hostname 372 B
Newer Older
  • Learn to ignore specific revisions
  • . /lib/functions/system.sh
    . /lib/functions/uci-defaults.sh
    
    set_hostname() {
    	local label_mac="$1"
    	local board_name_without_vendor="$(board_name | cut -d , -f2)"
    	local hostname="${board_name_without_vendor}${label_mac:+-${label_mac//:/}}"
    	ucidef_set_hostname "$hostname"
    }
    
    label_mac="$(get_mac_label)"
    board_config_update
    set_hostname "$label_mac"
    board_config_flush