X-Git-Url: http://ftp.carnet.hr/pub/carnet-debian/scm?a=blobdiff_plain;f=functions.sh;h=37bd11316c391186428710b27097e097c949c6d6;hb=b483296f7365f680585b2d1dbb55a316bb075126;hp=49fc2c6cea57763ca1feed37e20ce2ba7d4f4657;hpb=4eb4fa7dad117af95b07ca9f7a81ec4301e40254;p=carnet-tools-cn.git diff --git a/functions.sh b/functions.sh index 49fc2c6..37bd113 100644 --- a/functions.sh +++ b/functions.sh @@ -27,7 +27,8 @@ cp_get_ifaddr() { return 2 fi - ifaddr="`/sbin/ifconfig $interface | awk '/inet/{ printf("%s\n",substr($2,index($2,":")+1)) }'`" + #ifaddr="`/sbin/ifconfig $interface | awk '/inet /{ printf("%s\n",substr($2,index($2,":")+1)) }'`" + ifaddr="`/sbin/ifconfig $interface | awk '/inet /{ printf($2) }'`" if [ -z $ifaddr ]; then echo "cp_get_ifaddr: $interface: No ip address found" 1>&2 @@ -63,7 +64,8 @@ cp_get_ifmask() { return 1 fi - ifmask="`/sbin/ifconfig $interface | awk '/Mask/{if($3~/Mask/)a=$3;else if ($4~/Mask/)a=$4;printf ("%s\n", substr(a,index(a,":")+1))}'`" + #ifmask="`/sbin/ifconfig $interface | awk '/Mask/{if($3~/Mask/)a=$3;else if ($4~/Mask/)a=$4;printf ("%s\n", substr(a,index(a,":")+1))}'`" + ifmask="`/sbin/ifconfig $interface | awk '/netmask /{ printf($4) }'`" if [ -z "$ifmask" ]; then echo "cp_get_ifmask: $interface: No netmask found" 1>&2 @@ -487,6 +489,7 @@ cp_get_ldap_realm() { if [ ! -d /etc/ldap/slapd.d/ -a ! -f /etc/ldap/slapd.conf ]; then echo "cp_get_ldap_realm: /etc/ldap/slapd.{d/,conf}: No such file or directory" >&2 + return 2 fi cp_get_ldap_suffix || true