Add Color to Proxmox Logon - 2
Do you want to rice the logon screen of Proxmox? The idea is to show clearly the login as IP and FQDN and also all the colors and positions of the patch cables - this is not in stead of tagging cables its on top. #color #login #proxmox #update
This is a follow up on the popular Add Color to Proxmox Logon.
This will make permanent changes to the Pve banner, it means you will get the colorful logon screen after a re-boot. See also this post.
Workflow
First test and then write the new banner - remember to save a copy of it, some future update might/will alter the banner.
- First set up the screen according to part 1
- Edit and check with
ctrl
+d
- Save the
/etc/issue
cp /etc/issue /etc/issue.new
- Copy the
/usr/bin/pvebanner
cp /usr/bin/pvebanner /usr/pve/banner.orig
- Now we edit the
/usr/bin/pvebanner
nano /usr/bin/pvebanner
- We need to add some controls to use in the banner:
my $e = '\e'
my $4 = '\4'
my $n = '\n.\O' - Now add your new screen instead of the existing line
https://${localip}:8006/https://${localip}:8006/
- Test
Example
#!/usr/bin/perl
use strict;
use PVE::INotify;
use PVE::Cluster;
my $nodename = PVE::INotify::nodename();
my $localip = PVE::Cluster::remote_node_ip($nodename, 1);
my $e = '\e'
my $4 = '\4'
my $n = '\n.\O'
my $xline = '-' x 78;
my $banner = '';
if ($localip) {
$banner .= <<__EOBANNER;
$xline
Welcome to the Proxmox Virtual Environment. Please use your web browser to
configure this server - connect to:
,---. . .
| ,---.,---.,---.| |,---.,---.. .,---.
| ,---|`---.,---|| || `---.| |`---.
`---'`---^`---'`---^`---'` `---'`---'`---'
$e{bold}$e{cyan}https://$4{vmbr0v10}:8006/$e{reset}
$e{bold}$e{yellow}https://$n:8006/$e{reset}
VLAN Switch/port - panel/jack - cable to NIC
MGMT LAN $e{red} 18/5 <===> 18/5 $e{reset}$e{yellow}<===> enp5s0$e{reset}
VM LAN $e{green} 18/6 <===> 18/6 $e{reset}$e{red}<===> enp9s0$e{reset}
CoroSync $e{bold}$e{magenta} 18/7 <===> 18/7 $e{reset}\e{white}<===> enp14s0$e{reset}
$xline
__EOBANNER
}
open(ISSUE, ">/etc/issue");
print ISSUE $banner;
close(ISSUE);
exit (0);