File: network.sh

package info (click to toggle)
lizardfs 3.10.4%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,072 kB
  • ctags: 9,596
  • sloc: cpp: 83,275; sh: 8,951; python: 3,872; ansic: 332; pascal: 128; makefile: 60
file content (10 lines) | stat: -rw-r--r-- 253 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
get_ip_addr() {
	hostname -I | cut -f1 -d' '
}

# Usage: get_next_port_number out_variable
# This function has to modify global variable and cannot be run from a subshell
get_next_port_number() {
	((FIRST_PORT_TO_USE++))
	eval "$1"=$FIRST_PORT_TO_USE
}