批量创建VIP
#!/bin/shfor vip in `cat ./viplist | awk '{print $1}'` do DESTINATION=`grep $vip ./viplist | awk '{print $2}'` tmsh create ltm virtual /stage/$vip destination $DESTINATION:80 ip-protocol tcp source 0.0.0.0/0 source-address-translation { type automap } profiles add { /Common/tcp } done
批量创建pool
#!/bin/shfor pool in `cat ./poollist | awk '{print $1}'` do MEMBERS=`grep $pool ./poollist | awk '{print $2,$3}'` tmsh create ltm pool /Stage/$pool members add { $MEMBERS } monitor tcpdone
批量创建node
#!/bin/shfor node in `cat ./nodelist | awk '{print $1}'` do IPADDR=`grep $node ./nodelist | awk '{print $2}'` DESCRIPTION=`grep $node ./nodelist | awk '{print $3}'` tmsh create ltm node /Stage/$node address $IPADDR description $DESCRIPTIONdone