bmqp代码更新脚本

bmqp代码更新脚本

#!/bin/bash
# Author: royoy
# Date  : 09/2019

salt_bin=/bin/salt
node_g=xxxtyt_app
node_script=/data/shell/xxxtyt_app_codes_update.sh

update_codes(){
        salt -N $node_g cmd.run $node_script
}

# Interactive mode
while [[ $# -eq 0 ]]
do
        stty erase ^H
        font "Please input option: (u|update) ( q|e|quit|exit )" -n
        read OPTARG
        case $OPTARG in
                update|u)
                        update_codes
                        ;;
                exit|quit|q|e)
                        exit
        esac
done

# Auto mode
while getopts ":b:x:h:a:" opt
do
        case $opt in
                u)
                        update_codes
                        ;;
                \?)
                        font "Invalid option: -$OPTARG" -n
                        exit 1
                        ;;
        esac
done