source: epoptes/trunk/fuentes/epoptes-client/X50-client-env @ 295

Last change on this file since 295 was 295, checked in by mabarracus, 3 years ago

copy trusty epoptes code

File size: 1.6 KB
Line 
1###########################################################################
2# Export some useful vars in the LTSP session environment.
3# Sourced by LDM.
4#
5# Copyright (C) 2011 Alkis Georgopoulos <alkisg@gmail.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program.  If not, see <http://www.gnu.org/licenses/>.
19#
20# On Debian GNU/Linux systems, the complete text of the GNU General
21# Public License can be found in `/usr/share/common-licenses/GPL'.
22###########################################################################
23
24# Keep the following code synced with epoptes-client
25def_iface=$(route -n | sed -n "/^0.0.0.0/s/.* //p")
26def_iface=${def_iface:-$(route -n | awk '$2=="0.0.0.0" { print $8; exit }')}
27if [ -n "$def_iface" ]; then
28    MAC=$(ip -oneline -family inet link show dev "$def_iface" | sed "s/.*ether \([^ ]*\).*/\\1/")
29    MAC=$(echo "$MAC" | sed 'y/abcdef-/ABCDEF:/;s/[^A-F0-9:]//g')
30    test -n "$MAC" && CLIENT_ENV="$CLIENT_ENV LTSP_CLIENT_MAC=$MAC"
31fi
32
33# LTSP_FATCLIENT unfortunately isn't set in LTSP fat client sessions. Set it.
34test -n "$LTSP_FATCLIENT" && CLIENT_ENV="$CLIENT_ENV LTSP_FATCLIENT=$LTSP_FATCLIENT"
Note: See TracBrowser for help on using the repository browser.