#!/usr/bin/perl use warnings; use strict; require '/var/ipfire/general-functions.pl'; my %settings = (); $settings{'EXTIP'} = "1.1.1.5"; $settings{'NAME'} = "LB1"; $settings{'PORT'} = "8080"; $settings{'EPORT'} = "80"; $settings{'PROTO'} = "tcp"; $settings{'SEL'} = "rr"; $settings{'MODE'} = "fullnat"; $settings{'ENDPOINTS'} = "2.2.2.2:1|3.3.3.3:1|4.4.4.4:1"; my @loxicmd_options; push(@loxicmd_options, "create", "lb"); push(@loxicmd_options, "$settings{'EXTIP'}"); my $name = "--name=" . "$settings{'NAME'}"; push(@loxicmd_options, "$name"); my $proto = "--" . "$settings{'PROTO'}" . "=" . "$settings{'EPORT'}" . ":" . "$settings{'PORT'}"; push(@loxicmd_options, "$proto"); my $tmp = $settings{'ENDPOINTS'}; $tmp =~ s/\|/,/g; my $endpoints = "--endpoints=$tmp"; push(@loxicmd_options, "$endpoints"); print "The output is: ", (join " ", @loxicmd_options), "\n"; my $command = 'loxicmd'; =for my @args = ( 'create', 'lb', '1.1.1.4', '--tcp=80:8080', '--endpoints=1.1.1.1:1,2.2.2.2:1' ); =cut &General::system($command, @loxicmd_options);