aboutsummaryrefslogtreecommitdiffstats
path: root/main/perl-sys-hostname-long/hostname-f.patch
blob: 801eb736f2bc537e6eceba1e8fdf2477bcb1190f (plain)
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
When running with busybox "hostname", there is no "--fqdn" switch.
The same functionality is provided using the "-f" switch.

--- a/lib/Sys/Hostname/Long.pm
+++ b/lib/Sys/Hostname/Long.pm
@@ -69,7 +69,7 @@
 	},
 
 	'exec_hostname_fqdn' => {
-		'title' => 'Execute "hostname --fqdn"',
+		'title' => 'Execute "hostname -f"',
 		'description' => '',
 		'exec' => sub {
 			# Skip for Solaris, and only run as non-root
@@ -77,9 +77,9 @@
 			my $tmp;
 			if ( $^O ne 'darwin' ) {
 				if ($< == 0) {
-					$tmp = `su nobody -c "hostname --fqdn"`;
+					$tmp = `su nobody -c "hostname -f"`;
 				} else {
-					$tmp = `hostname --fqdn`;
+					$tmp = `hostname -f`;
 				}
 				$tmp =~ tr/\0\r\n//d;
 			}