[debian-edu-commits] [Git][debian-edu/debian-edu-config][master] 2 commits: get-ldap-ltsp-config: Fix detection of MAC address

Dominik George gitlab at salsa.debian.org
Fri Mar 1 11:39:55 GMT 2019


Dominik George pushed to branch master at Debian Edu / debian-edu-config


Commits:
56c71c7d by Dominik George at 2019-03-01T11:32:20Z
get-ldap-ltsp-config: Fix detection of MAC address

- - - - -
7e5c6be6 by Dominik George at 2019-03-01T11:38:36Z
update-hostname-from-ip: Always print hostname if -n is used

N.B.: At least get-ldap-ltsp-config relies on that.

- - - - -


2 changed files:

- sbin/update-hostname-from-ip
- share/ltsp/get-ldap-ltsp-config


Changes:

=====================================
sbin/update-hostname-from-ip
=====================================
@@ -120,17 +120,15 @@ if $USEMAC && [ -z "$HOSTNAME" ] ; then
     SOURCE="hardware MAC address"
 fi
 
-# Already got the correct host name?
-if [ "$HOSTNAME" = "$(uname -n)" ] ; then
-    exit 0
-fi
-
 if [ "$HOSTNAME" ]; then
     if $onlyprint ; then
 	echo $HOSTNAME
 	exit 0
     else
-	sethostname "$HOSTNAME" "$SOURCE"
+        # Already got the correct host name?
+        if [ "$HOSTNAME" != "$(uname -n)" ] ; then
+            sethostname "$HOSTNAME" "$SOURCE"
+        fi
     fi
 else
     exit 1


=====================================
share/ltsp/get-ldap-ltsp-config
=====================================
@@ -88,7 +88,7 @@ setup_from_ldap() {
 }
 
 lookup_mac_addrs() {
-    PATH=/sbin:$PATH LANG=C ifconfig 2>/dev/null | grep -i hwaddr | awk '{print $5}' | sort -u
+    PATH=/sbin:$PATH LANG=C ip link 2>/dev/null | grep -i link/ether | awk '{print $2}' | sort -u
 }
 
 # Only check LDAP when the result can be cached



View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/compare/79394ad75ccf14d9c62751dc67165ca2dcd74079...7e5c6be68bb65fb4606ffa7c7d1ca58817d1fa1a

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/compare/79394ad75ccf14d9c62751dc67165ca2dcd74079...7e5c6be68bb65fb4606ffa7c7d1ca58817d1fa1a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-commits/attachments/20190301/a85ea86a/attachment-0001.html>


More information about the debian-edu-commits mailing list