Ignore:
Timestamp:
Oct 15, 2010, 11:19:33 AM (14 years ago)
Author:
rock
Message:

The same

File:
1 edited

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/drbl_client_cmd

    r211 r212  
    8282
    8383
    84 # = 3. Check client exist
    85 grep $client_name $Work_Home/etc/IP_HOST_TABLE >> /dev/null
    86 if [ $? -ne 0 ]; then
    87     echo "[Error] This host is not DRBL client"
    88     exit 2
    89 fi
    90 
     84# = 3. ssh client to execute command  =
    9185echo "[$client_name]"
    9286
    93 # = 4. ssh host to deploy VM  =
    94 # local varibales
    95 host_IP=$(cat $Work_Home/etc/IP_HOST_TABLE | grep $client_name | awk '{print $1}')
     87# check network
     88IP_status="online"
     89ping -c1 -w1 $client_name > /dev/null 2>&1 || IP_status="offline"
    9690
    97 # start ssh
    98 ssh -o StrictHostKeyChecking=no $host_IP "$command"
    99 
     91if [ $IP_status == "offline" ]; then
     92    echo "[Error] $client_name's network is offline !!!"
     93else
     94    ssh -o StrictHostKeyChecking=no $client_name "$command"
     95fi
Note: See TracChangeset for help on using the changeset viewer.