Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
get-ldap-ltsp-config: Fix detection of MAC address
· 56c71c7d
Dominik George
authored
Mar 01, 2019
56c71c7d
update-hostname-from-ip: Always print hostname if -n is used
· 7e5c6be6
Dominik George
authored
Mar 01, 2019
N.B.: At least get-ldap-ltsp-config relies on that.
7e5c6be6
Hide whitespace changes
Inline
Side-by-side
sbin/update-hostname-from-ip
View file @
7e5c6be6
...
...
@@ -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
View file @
7e5c6be6
...
...
@@ -88,7 +88,7 @@ setup_from_ldap() {
}
lookup_mac_addrs
()
{
PATH
=
/sbin:
$PATH
LANG
=
C i
fconfig
2>/dev/null |
grep
-i
hwadd
r |
awk
'{print $
5
}'
|
sort
-u
PATH
=
/sbin:
$PATH
LANG
=
C i
p
link
2>/dev/null |
grep
-i
link
/ethe
r |
awk
'{print $
2
}'
|
sort
-u
}
# Only check LDAP when the result can be cached
...
...