File: fqdn-etc-host.sh

package info (click to toggle)
drbl 5.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,996 kB
  • sloc: sh: 43,555; perl: 8,820; xml: 867; makefile: 135
file content (19 lines) | stat: -rwxr-xr-x 519 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
# Author: Steven Shiau <steven _at_ clonezilla org>
# License: GPL

# Load DRBL setting and functions
DRBL_SCRIPT_PATH="${DRBL_SCRIPT_PATH:-/usr/share/drbl}"

. $DRBL_SCRIPT_PATH/sbin/drbl-conf-functions

#
eth_wan_port="$1"
[ -z "$eth_wan_port" ] && exit 1
eth_wan_ip="$(drbl-get-ipadd $eth_wan_port)"

# authough RH-like hostname will give FQDN name, but it is not in Debian.
hostnm="$(hostname | cut -d"." -f1)"
dnsdomainnm="$(dnsdomainname)"
fqdn="$hostnm.$dnsdomainnm"
echo "$eth_wan_ip $fqdn $hostnm"