File: gethost.pl

package info (click to toggle)
cfingerd 1.4.3-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 968 kB
  • sloc: ansic: 3,776; perl: 501; makefile: 137; sh: 73
file content (29 lines) | stat: -rw-r--r-- 685 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## Get Fully Qualified Domain Name
## by Ken Hollis <khollis@bitgate.com>
##
## This program is GPLed.  Please read the LICENSE file for more information.
## Copyright (C) 1996, Bitgate Software.

sub get_fqdn {
	local($question, $config) = @_;

	&disp_file($config);

	local($hostname) = `hostname`;
	chop($hostname);

	local($domainname) = `domainname`;
	chop($domainname);

	if (($hostname ne "(none)") && ($domainname ne "(none)")) {
		local($fqdn) = $hostname . "." . $domainname;
	} elsif ($hostname eq "(none)") {
		local($fqdn) = $domainname;
	} elsif ($domainname eq "(none)") {
		local($fqdn) = $hostname;
	}

	$fqdn = &ask_question($question, $fqdn, STRING_QUESTION);
}

1;