Line 132: |
Line 132: |
| /etc/e-smith/events/actions/initialize-default-databases | | /etc/e-smith/events/actions/initialize-default-databases |
| | | |
− | mkdir -p /etc/e-smith/templates-custom/etc/sysconfig/network/ | + | mkdir -p /etc/e-smith/templates-custom/etc/sysconfig/network/ |
− | | + | echo '# GATEWAYDEV disabled for dedibox network' > /etc/e-smith/templates-custom/etc/sysconfig/network/40GATEWAYDEV |
− | echo '# GATEWAYDEV disabled for dedibox network' > /etc/e-smith/templates-custom/etc/sysconfig/network/40GATEWAYDEV | + | echo '# GATEWAY disabled for dedibox network' > /etc/e-smith/templates-custom/etc/sysconfig/network/50GATEWAY |
− | echo ' # GATEWAY disabled for dedibox network ' > /etc/e-smith/templates-custom/etc/sysconfig/network/50GATEWAYto pass in THIS_DEVICE MORE_DATA \ n " Unless ( defined $ THIS_DEVICE ) ; | + | expand-template /etc/sysconfig/network |
| + | mkdir -p /etc/e-smith/templates-custom/etc/sysconfig/network-scripts/route-ethX |
| + | cat <<'EOF' > /etc/e-smith/templates-custom/etc/sysconfig/network-scripts/route-ethX/20gateway |
| + | { |
| + | die "Need to pass THIS_DEVICE in MORE_DATA\n" unless (defined $THIS_DEVICE); |
| | | |
− | my $ device = $ ExternalInterface { Name } ; | + | my $device = $ExternalInterface{Name}; |
− | Unless ( $ device ) | + | unless ($device) |
− | { | + | { |
− | warn ( "Can not determined for external network device name" ) ; | + | warn("Can't determine device name for external network"); |
− | return "# template expansion error - Can not determined for external network device name" ;
| + | return "# template expansion error - Can't determine device name for external network"; |
− | }
| + | } |
| | | |
− | return "# Gateway Applies only one external interface" | + | return "# Gateway only applies on external interface" |
− | Unless ( ExternalInterface $ { Name } eq $ THIS_DEVICE ) ; | + | unless ($ExternalInterface{Name} eq $THIS_DEVICE); |
| | | |
− | my $ gw = $ ExternalInterface { 'gateway' } ; | + | my $gw = $ExternalInterface{'Gateway'}; |
| | | |
− | $ OUT =. " $ gw dev $ THIS_DEVICE \ n " ; | + | $OUT .= "$gw dev $THIS_DEVICE\n"; |
− | $ OUT =. "default via $ gw dev $ THIS_DEVICE " ;
| + | $OUT .= "default via $gw dev $THIS_DEVICE"; |
| } | | } |
− | EOF | + | EOF |
| | | |
| If you have got it right then you should be able to run the following without error : | | If you have got it right then you should be able to run the following without error : |