From: Michael Tremer Date: Mon, 15 Jun 2020 15:07:35 +0000 (+0000) Subject: web: Hide certain menu items when running in cloud environments X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d011453b8c1d0cfd101dd0ff3d09366cf1e55f6;p=people%2Fms%2Fipfire-2.x.git web: Hide certain menu items when running in cloud environments This used to be only hidden on AWS. Signed-off-by: Michael Tremer --- diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index 376b6a09a9..8ee5eaa5d5 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -1288,6 +1288,10 @@ sub formatBytes { # Cloud Stuff +sub running_in_cloud() { + return &running_on_ec2() || &running_on_gcp(); +} + sub running_on_ec2() { if (-e "/var/run/aws-instance-id") { return 1; diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index 8b42bf0233..1046f59921 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -170,8 +170,8 @@ sub genmenu { $menu->{'02.status'}{'subMenu'}->{'74.modem-status'}{'enabled'} = 1; } - # Disbale unusable things on EC2 - if (&General::running_on_ec2()) { + # Disbale unusable things in cloud environments + if (&General::running_in_cloud()) { $menu->{'03.network'}{'subMenu'}->{'30.dhcp'}{'enabled'} = 0; $menu->{'03.network'}{'subMenu'}->{'80.macadressmenu'}{'enabled'} = 0; $menu->{'03.network'}{'subMenu'}->{'90.wakeonlan'}{'enabled'} = 0;