netzint / linuxmuster-linbo7

Next generation linbo
GNU General Public License v3.0
0 stars 1 forks source link

linbo-remote strips school from hostname #1

Open PLanB2008 opened 1 year ago

PLanB2008 commented 1 year ago

MacAddress cant be determined in this case...

https://github.com/netzint/linuxmuster-linbo7/blob/960d1fb34287bc0fe9893b7f605f6bcc65a226ef/serverfs/usr/share/linuxmuster/linbo/linbo-remote.sh#L415

PLanB2008 commented 1 year ago

Hence get_mac uses ldbsearch this seems to be wrong:

# get host's mac address from AD
# get_mac <ip|hostname|mac>
get_mac(){
  local attr="sophomorixComputerMAC"
  if validip "$1"; then
    $LDBSEARCH "(sophomorixComputerIP=$1)" $attr | grep ^$attr | awk '{print $2}'
  elif validhostname "$1"; then
    $LDBSEARCH "(sophomorixDnsNodename=$(tolower $1))" $attr | grep ^$attr | awk '{print $2}'
  elif validmac "$1"; then
    $LDBSEARCH "($attr=$(toupper $1))" $attr | grep ^$attr | awk '{print $2}'
  else
    return 1
  fi
}