Debian Codegraph @

scripts/bin/drbl-get-macadd

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # Authors: Steven Shiau <steven _at_ clonezilla org>, Ceasar Sun <ceasar_dot_sun_at_gmail com>
3 # License: GPL
4 # Description: Get the MAC address of network card interface
5
6 # Load DRBL setting and functions
7 DRBL_SCRIPT_PATH="${DRBL_SCRIPT_PATH:-/usr/share/drbl}"
8
9 . $DRBL_SCRIPT_PATH/sbin/drbl-conf-functions
10
11 #
12 ethx=$1
13 export LC_ALL=C
14
15 Usagescip-shell shell shell-project 0.0.0 Usage().() {
16 echoscip-shell system . . echo. "Get the MAC address of network card interface"
17 echoscip-shell system . . echo. "Usage:"
18 echoscip-shell system . . echo. "$(basenamescip-shell system . . basename. $0) INTERFACE"
19 echoscip-shell system . . echo. "Ex: $(basenamescip-shell system . . basename. $0) eth0"
20 }
21
22 [scip-shell system . . `[`. -z "$ethx" ] && Usagescip-shell shell shell-project 0.0.0 Usage(). && exit 1
23 if ! LC_ALL=C ip link show dev $ethx >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1; then
24 exit 1
25 fi
26 # Ex: link/ether 00:0c:29:81:a0:d5 brd ff:ff:ff:ff:ff:ff
27
28 _nic_mac=$(LC_ALL=C ip link show dev $ethx | awkscip-shell system . . awk. '/link\// {print $2}scip-shell filesystem . . `/link\// {print $2}`.' | trscip-shell system . . tr. '[A-Z]' '[a-z]')
29 echoscip-shell system . . echo. $_nic_mac
30 exit 0