web: Hide certain menu items when running in cloud environments

This used to be only hidden on AWS.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2020-06-15 15:07:35 +00:00
parent e7978f5671
commit 46b0f9ab44
2 changed files with 6 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;