shell: print(f) to echo where possible

Spotted by: @fabianfrz
This commit is contained in:
Franco Fichtner 2018-07-06 21:01:29 +00:00
parent 94293fa8db
commit 45bd265180

View File

@ -41,12 +41,12 @@ $machine = trim(shell_exec('uname -p'));
$domain = $config['system']['domain'];
$product = $g['product_name'];
print "\n*** {$hostname}.{$domain}: {$product} {$version} ({$machine}/${flavour}) ***\n";
echo "\n*** {$hostname}.{$domain}: {$product} {$version} ({$machine}/${flavour}) ***\n";
$iflist = get_configured_interface_with_descr(false, true);
if (empty($iflist)) {
printf("\n\tNo network interfaces are assigned.\n");
echo "\n\tNo network interfaces are assigned.\n";
return;
}
@ -124,20 +124,20 @@ foreach ($iflist as $ifname => $friendly) {
}
}
printf("\n");
echo PHP_EOL;
if (isset($config['system']['ssh']['enabled']) || $config['system']['webgui']['protocol'] == 'https') {
printf("\n");
echo PHP_EOL;
}
if ($config['system']['webgui']['protocol'] == 'https') {
printf(' HTTPS: ');
echo ' HTTPS: ';
passthru('openssl x509 -in /var/etc/cert.pem -noout -fingerprint -sha256 | sed "s/Fingerprint=//" | sed -E "s/(^.{55})/\1, /" | tr "," "\n"');
}
if (openssh_enabled()) {
foreach (glob('/conf/sshd/ssh_host_*_key.pub') as $ssh_host_pub_key_file_path) {
printf(' SSH: ');
echo ' SSH: ';
passthru("ssh-keygen -l -f " . escapeshellarg($ssh_host_pub_key_file_path) . " | awk '{ print $2 \" \" $4 }' | sed 's/SHA256:/SHA256 /'");
}
}