From 45bd2651808f8bf6c6dca85c36b5126201c71f70 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 6 Jul 2018 21:01:29 +0000 Subject: [PATCH] shell: print(f) to echo where possible Spotted by: @fabianfrz --- src/opnsense/scripts/shell/banner.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/opnsense/scripts/shell/banner.php b/src/opnsense/scripts/shell/banner.php index 136afebf7..ec6a38dc1 100755 --- a/src/opnsense/scripts/shell/banner.php +++ b/src/opnsense/scripts/shell/banner.php @@ -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 /'"); } }