diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2008-04-07 15:06:40 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2008-04-07 15:06:40 -0700 |
commit | 90bfb8446d408313e9c73335889629e10e616265 (patch) | |
tree | aac3967b9fc078297a802f04d7b431b776624b34 /scripts/VyattaClusterConfig.pm | |
parent | 63d4544c809b1fbfea9e40ef00bca1f963113c6a (diff) | |
download | vyatta-cluster-90bfb8446d408313e9c73335889629e10e616265.tar.gz vyatta-cluster-90bfb8446d408313e9c73335889629e10e616265.zip |
fix for bugs 2970, 3109, 3110:
* replace output messages.
* add interface checks.
Diffstat (limited to 'scripts/VyattaClusterConfig.pm')
-rw-r--r-- | scripts/VyattaClusterConfig.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/VyattaClusterConfig.pm b/scripts/VyattaClusterConfig.pm index 08c31de..a7ce914 100644 --- a/scripts/VyattaClusterConfig.pm +++ b/scripts/VyattaClusterConfig.pm @@ -169,6 +169,14 @@ sub check_interfaces { if ($? >> 8) { return "interface $_ does not exist"; } + my $link = `ip link show $_ | grep $_`; + if (($link =~ /NO-CARRIER/) || !($link =~ /,UP/)) { + return "interface $_ is not connected"; + } + system("ip addr show dev $_ |grep 'inet ' |grep -q 'scope global'"); + if ($? >> 8) { + return "interface $_ is not configured"; + } } return undef; } |