Last active
September 6, 2024 13:18
Revisions
-
roelds revised this gist
Sep 6, 2024 . No changes.There are no files selected for viewing
-
roelds revised this gist
Sep 6, 2024 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,10 @@ # uses network-manager myip=$(nmcli device show | grep -m 1 "IP4.ADDRESS" | awk '{print substr($2, 1, length($2)-3)}') myentry=$(echo -n $myip && echo -e "\t thishost.thisdomain.local" && echo -e "\t thishost") echo $myentry # get nic device name (enps) nmcli device show | grep -m 1 "GENERAL.DEVICE" | awk '{print $2}' # get nic mac addr nmcli device show | grep -m 1 "GENERAL.HWADDR" | awk '{print $2}' -
roelds created this gist
Sep 1, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ myip=$(nmcli device show | grep -m 1 "IP4.ADDRESS" | awk '{print substr($2, 1, length($2)-3)}') myentry=$(echo -n $myip && echo -e "\t thishost.thisdomain.local" && echo -e "\t thishost") echo $myentry