~ampelbein/ubuntu/oneiric/heartbeat/lp-770743

« back to all changes in this revision

Viewing changes to resources/OCF/IPaddr

  • Committer: Bazaar Package Importer
  • Author(s): Ante Karamatic
  • Date: 2009-08-10 19:29:25 UTC
  • mfrom: (5.2.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20090810192925-9zy2llcbgavbskf7
Tags: 2.99.2+sles11r9-5ubuntu1
* New upstream snapshot
* Adjusted heartbeat.install and rules for documentation path

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
<actions>
196
196
<action name="start"   timeout="90" />
197
197
<action name="stop"    timeout="100" />
198
 
<action name="monitor" depth="10"  timeout="20s" interval="5s" start-delay="1s" />
 
198
<action name="monitor" depth="10"  timeout="20s" interval="5s" start-delay="0" />
199
199
<action name="validate-all"  timeout="30s" />
200
200
<action name="meta-data"  timeout="5s" />
201
201
</actions>
247
247
    CMD="OCF_RESKEY_cidr_netmask=32 OCF_RESKEY_ip=$1 OCF_RESKEY_nic=$ifname $FINDIF"
248
248
    if
249
249
      NICINFO=`eval $CMD`
250
 
      NICINFO=`echo $NICINFO | tr -s " "`
 
250
      NICINFO=`echo $NICINFO | tr "     " " " | tr -s " "`
251
251
    then
252
252
        netmask_text=`echo "$NICINFO" | cut -f3 -d " "`
253
253
        broadcast=`echo "$NICINFO" | cut -f5 -d " "`
299
299
}
300
300
 
301
301
find_interface_bsd() {
302
 
    #$IFCONFIG $IFCONFIG_A_OPT | grep "inet.*[: ]$OCF_RESKEY_ip "
303
 
    $IFCONFIG | grep "$ipaddr" -B20 | grep "UP," | tail -n 1 | cut -d ":" -f 1
 
302
    $IFCONFIG $IFCONFIG_A_OPT | awk -v ip_addr="$ipaddr" '
 
303
                                        /UP,/ && $0 ~ /^[a-z]+[0-9]:/ { 
 
304
                                                if_name=$1; sub(":$","",if_name); 
 
305
                                        }
 
306
                                        $1 == "inet" && $2 == ip_addr {
 
307
                                                print if_name 
 
308
                                                exit(0)
 
309
                                        }'
 
310
 
304
311
}
305
312
 
306
313
#
601
608
 
602
609
    if [ "$SYSTYPE" = "DarwinBSD" -a "$NIC_unique" = "lo0" ]; then
603
610
        # Darwin can't send ARPs on loopback devices
604
 
        SENDARP=""
 
611
        SENDARP="x$SENDARP" # Prevent the binary from being found
605
612
    fi
606
613
 
607
 
    if [ x$SENDARP != x ]; then
 
614
    if [ -x $SENDARP ]; then
608
615
        TARGET_INTERFACE=`echo $NIC_unique | sed 's%:.*%%'`
609
616
        SENDARPPIDFILE="$SENDARPPIDDIR/send_arp-$OCF_RESKEY_ip"    
610
617