Debian Codegraph @

scripts/bin/get-port-link-2-drbl-srv

raw symbols SCIP
1 #!/bin/bash
2 # Author: Steven Shiau <steven _at_ clonezilla org>
3 # License: GPL
4 # This script is used in DRBL client to show the port of client which is connected to DRBL server. It can be used for more than one NIC or alias IP addresses.
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 if [ -f /etc/diskless-image/config ]; then
13 # Load config file
14 . /etc/diskless-image/config
15 else
16 exit 1
17 fi
18
19 PORT_LISTS="$(get-nic-devs)"
20
21 IP_link_2_srv="$(get-ip-link-2-drbl-srv)"
22 for i in $PORT_LISTS; do
23 ip="$(drbl-get-ipadd $i)"
24 if [ "$ip" = "$IP_link_2_srv" ]; then
25 echo "$i"
26 break
27 fi
28 done