]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
aws-functions.pl: Drop file and move functions to general-functions.pl
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 15 Jun 2020 15:01:42 +0000 (15:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 19 Jun 2020 17:14:58 +0000 (17:14 +0000)
There is not enough stuff that it is justified to have an own file.

This patch therefore merges everything into general-functions.pl.

There are no functional changes.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/cfgroot/aws-functions.pl [deleted file]
config/cfgroot/general-functions.pl
config/cfgroot/header.pl
config/rootfiles/common/configroot
lfs/configroot

diff --git a/config/cfgroot/aws-functions.pl b/config/cfgroot/aws-functions.pl
deleted file mode 100644 (file)
index 5fd9712..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/perl -w
-############################################################################
-#                                                                          #
-# This file is part of the IPFire Firewall.                                #
-#                                                                          #
-# IPFire is free software; you can redistribute it and/or modify           #
-# it under the terms of the GNU General Public License as published by     #
-# the Free Software Foundation; either version 2 of the License, or        #
-# (at your option) any later version.                                      #
-#                                                                          #
-# IPFire is distributed in the hope that it will be useful,                #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
-# GNU General Public License for more details.                             #
-#                                                                          #
-# You should have received a copy of the GNU General Public License        #
-# along with IPFire; if not, write to the Free Software                    #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
-#                                                                          #
-# Copyright (C) 2018 IPFire Team <info@ipfire.org>.                        #
-#                                                                          #
-############################################################################
-
-package AWS;
-
-sub running_on_ec2() {
-       if (-e "/var/run/aws-instance-id") {
-               return 1;
-       }
-
-       return 0;
-}
-
-1;
index 4c7cf09a8db394db903970daa156dc6e18d6c1d9..6ddad28d0dbfec849cc66da5c789ed0f080b4170 100644 (file)
@@ -1286,4 +1286,14 @@ sub formatBytes {
        return sprintf("%.2f %s", $bytes, $unit);
 }
 
+# Cloud Stuff
+
+sub running_on_ec2() {
+       if (-e "/var/run/aws-instance-id") {
+               return 1;
+       }
+
+       return 0;
+}
+
 1;
index e8d9d377cb9abfc3997cfcac13602358ed995855..8b42bf02337371872dffbf93153d4cfcb630d768 100644 (file)
@@ -19,8 +19,6 @@ use Time::Local;
 
 $|=1; # line buffering
 
-require "/var/ipfire/aws-functions.pl";
-
 $Header::revision = 'final';
 $Header::swroot = '/var/ipfire';
 $Header::graphdir='/srv/web/ipfire/html/graphs';
@@ -173,7 +171,7 @@ sub genmenu {
     }
 
     # Disbale unusable things on EC2
-    if (&AWS::running_on_ec2()) {
+    if (&General::running_on_ec2()) {
         $menu->{'03.network'}{'subMenu'}->{'30.dhcp'}{'enabled'} = 0;
         $menu->{'03.network'}{'subMenu'}->{'80.macadressmenu'}{'enabled'} = 0;
         $menu->{'03.network'}{'subMenu'}->{'90.wakeonlan'}{'enabled'} = 0;
index 67c4abc751604ed6b727e4f7979f5d33575232fe..664247b12c4749133a520a6b5677d28bfc84b68d 100644 (file)
@@ -9,7 +9,6 @@ usr/sbin/firewall-policy
 var/ipfire/addon-lang
 var/ipfire/auth
 #var/ipfire/auth/users
-var/ipfire/aws-functions.pl
 #var/ipfire/backup
 var/ipfire/backup/exclude.user
 var/ipfire/backup/include.user
index 2c9dbe0e382f34f6354a56b12a6b14682407c497..ee320d8cf2ab365b88ea9ede8bb3fbd2eb56c3eb 100644 (file)
@@ -79,7 +79,6 @@ $(TARGET) :
        cp $(DIR_SRC)/config/cfgroot/general-functions.pl       $(CONFIG_ROOT)/
        cp $(DIR_SRC)/config/cfgroot/network-functions.pl       $(CONFIG_ROOT)/
        cp $(DIR_SRC)/config/cfgroot/geoip-functions.pl         $(CONFIG_ROOT)/
-       cp $(DIR_SRC)/config/cfgroot/aws-functions.pl           $(CONFIG_ROOT)/
        cp $(DIR_SRC)/config/cfgroot/ids-functions.pl           $(CONFIG_ROOT)/
        cp $(DIR_SRC)/config/cfgroot/lang.pl                    $(CONFIG_ROOT)/
        cp $(DIR_SRC)/config/cfgroot/countries.pl               $(CONFIG_ROOT)/