zoukankan      html  css  js  c++  java
  • 从CMDB查询云平台组件或者IP简单脚本

    #!/bin/bash
    #author xiaoweige
    #todo: ip -- > ingredient or ingredient -- > ip

    #todo: get the ip of the given ingredient
    function ingredient_ip() {
    #todo: get the ip of the ingredient given
      mysql -uroot -pengine -e "select * from ipandingredient.ipandingredient where env ='$1' and ingredient='$2'"
    }
    #todo: not sure what the ingredient is
    function search_ingredient() {
      mysql -uroot -pengine -e "use ipandingredient ;select * from ipandingredient where ingredient like '%${1}%' "

    }
    #todo: get the ip of the ingredient given
    function ip_ingredient() {
      mysql -uroot -pengine -e "use ipandingredient; select * from ipandingredient where env='$1' and ip='$2' "

    }

    function usage() {
      echo "to get ingredient USAGE: ./$0 ip"
      echo "to get ip USAGE: ./$0 ingredient"
      echo "search ingredient ./$0 sth"

    }

    function main(){
      if [ $# -eq 0 ]
      then
        usage
      elif [ $# -eq 1 ]
      then
        search_ingredient $1
      elif [ $# -eq 2 ]
      then
      argtype=`echo $2|egrep [1-9+.]`
      if [ -z $argtype ]
      then
        ingredient_ip $1 $2
      else
        ip_ingredient_ip $1 $2
      fi
    fi

    }
    main $*

  • 相关阅读:
    unity fbx 导出动画
    Unity正交模式摄像机与屏幕适配的方法
    unity3d 代码动态添加,修改BoxCollider2D
    Unity3D 移动摇杆处理
    protobuff 编译注意事项
    sendBroadcast无法接收消息可能原因
    FB相关
    上传速度慢
    CocosCreator与Laya2.0区别
    LayaBox 常用技巧
  • 原文地址:https://www.cnblogs.com/hixiaowei/p/9038862.html
Copyright © 2011-2022 走看看