]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
AWS: Add support for ORANGE
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 28 Jun 2018 10:01:33 +0000 (11:01 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 28 Jun 2018 10:01:33 +0000 (11:01 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/helper/aws-setup

index 2fae9ea18c7e40584ea378ccb690b25c8678b654..19edb2b921551f2110b09ff38dd249a793d55258 100644 (file)
@@ -69,10 +69,8 @@ import_aws_configuration() {
        eval $(/usr/local/bin/readhash <(grep -E "^DNS([0-9])=" /var/ipfire/ethernet/settings 2>/dev/null))
 
        # Import network configuration
-       (
-               # RED + GREEN
-                       echo "CONFIG_TYPE=1"
-       ) > /var/ipfire/ethernet/settings
+       local config_type=1
+       : > /var/ipfire/ethernet/settings
 
        local mac
        for mac in $(get network/interfaces/macs/); do
@@ -145,9 +143,27 @@ import_aws_configuration() {
                                        echo "GREEN_BROADCAST=${broadcast}"
                                ) >> /var/ipfire/ethernet/settings
                                ;;
+
+                       # ORANGE
+                       2)
+                               config_type=2
+
+                               (
+                                       echo "ORANGE_DEV=orange0"
+                                       echo "ORANGE_MACADDR=${mac}"
+                                       echo "ORANGE_DESCRIPTION='${interface_id}'"
+                                       echo "ORANGE_ADDRESS=${ipv4_address}"
+                                       echo "ORANGE_NETMASK=${netmask}"
+                                       echo "ORANGE_NETADDRESS=${netaddress}"
+                                       echo "ORANGE_BROADCAST=${broadcast}"
+                               ) >> /var/ipfire/ethernet/settings
+                               ;;
                esac
        done
 
+       # Save CONFIG_TYPE
+       echo "CONFIG_TYPE=${config_type}" >> /var/ipfire/ethernet/settings
+
        # Import SSH keys
        local line
        for line in $(get "public-keys/"); do