• cloud foundry 中 url map/unmap


    cloud foundry 中遇到url较多的应用进程,真是令人头疼的一件事,只能抽时间写个自动map和unmap的小脚本。

    #!/bin/bash
    # ********* USEAGE *************
    
    # Time:2017/5/17
    # version:V 1.0.0
    # auth: songfucai
    # content:user to map or unmap app's url
    # note:
    #     1.only suitable for china zuul
    # *****************************
    
    ####map-route function
    function mapRoute()
    {
    echo -n "Please type in the name of the application need to map-route....."
    read mapapp
    if [[ $mapapp == "exit" ]];then
        exit 1
    fi
    if read -t 30 -p "Whether to confirm to map-route ${mapapp} ?[y|n]:" yn
    then
        if [[ $yn == [Yy] ]];then
             cf  map-route  $mapapp     domain  -n  host
             cf a|grep appname
        elif [[ $yn == [Nn] ]];then
                exit 0
        elif [[ $yn == "exit" ]];then
            exit 1
        else [[ $yn != [YyNn] ]]
            unmapRoute;
     
        fi
    else
        echo " "
        echo -e "e[0;33;1mTimeOut ...e[0m"
        exit 1
    fi 
    }
    
    ####unmap-route function
    function unmapRoute()
    {
    echo -n "Please type in the name of the application need to unmap-route....."
    read unmapapp
    if [[ $unmapapp == "exit" ]];then
        exit 1
    fi
    if read -t 30 -p "Whether to confirm to unmap-route ${unmapapp} ?[y|n]:" yn
    then
        if [[ $yn == [Yy] ]];then
            cf  unmap-route  $unmapapp   domain  -n  host
            cf a|grep appname
    
        elif [[ $yn == [Nn] ]];then
            exit 0
        elif [[ $yn == "exit" ]];then
            exit 1
        else [[ $yn != [YyNn] ]]
            mapRoute;
        fi
    else
        echo " "
        echo -e "e[0;33;1mTimeOut ...e[0m"
        exit 1
    fi     
    }
    
    echo "only suitable for china zone appname....."
    mapRoute;
    unmapRoute;
  • 相关阅读:
    mhWaveEdit 1.4.8
    FFmpeg — 屏幕录制器材
    GNOME 主题: Troll
    cGmail — 主动反省邮件
    最小化布置 Ubuntu
    GNOME Do — 疾速翻开法式和文件
    PyTone 一个控制台音乐播放器
    高恪守编辑器 VIM-把持篇(2)
    Cankiri:玲珑实用的屏幕录像机
    LiVES 0.9.6pre4
  • 原文地址:https://www.cnblogs.com/husbandmen/p/7054963.html
Copyright © 2020-2023  润新知