mirror of
				https://github.com/xcat2/confluent.git
				synced 2025-11-04 05:12:32 +00:00 
			
		
		
		
	Update functions to be more thorough
confluent_mgr could be ipv6 or may need to be updated from a link local or may need to go to copernicus data to work.
This commit is contained in:
		@@ -1,9 +1,37 @@
 | 
			
		||||
function test_mgr() {
 | 
			
		||||
    if curl -s https://${1}/confluent-api/ > /dev/null; then
 | 
			
		||||
        return 0
 | 
			
		||||
    fi
 | 
			
		||||
    return 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function set_confluent_vars() {
 | 
			
		||||
    if [ -z "$nodename" ]; then
 | 
			
		||||
        nodename=$(grep ^NODENAME: /etc/confluent/confluent.info | awk '{print $2}')
 | 
			
		||||
    fi
 | 
			
		||||
    if [[ "$confluent_mgr" == *"%"* ]]; then
 | 
			
		||||
        confluent_mgr=""
 | 
			
		||||
    fi
 | 
			
		||||
    if [ -z "$confluent_mgr" ]; then
 | 
			
		||||
        confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
        if ! test_mgr $confluent_mgr; then
 | 
			
		||||
            confluent_mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
            if [[ "$confluent_mgr" = *":"* ]]; then
 | 
			
		||||
                confluent_mgr="[$confluent_mgr]"
 | 
			
		||||
            fi
 | 
			
		||||
        fi
 | 
			
		||||
        if ! test_mgr $confluent_mgr; then
 | 
			
		||||
            BESTMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|1$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//')
 | 
			
		||||
            OKMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|0$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//')
 | 
			
		||||
            for confluent_mgr in $BESTMGRS $OKMGRS; do
 | 
			
		||||
                if [[ $confluent_mgr == *":"* ]]; then
 | 
			
		||||
                    confluent_mgr="[$confluent_mgr]"
 | 
			
		||||
                fi
 | 
			
		||||
                if test_mgr $confluent_mgr; then
 | 
			
		||||
                    break
 | 
			
		||||
                fi
 | 
			
		||||
            done
 | 
			
		||||
        fi
 | 
			
		||||
    fi
 | 
			
		||||
    if [ -z "$confluent_profile" ]; then
 | 
			
		||||
        confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,37 @@
 | 
			
		||||
function test_mgr() {
 | 
			
		||||
    if curl -s https://${1}/confluent-api/ > /dev/null; then
 | 
			
		||||
        return 0
 | 
			
		||||
    fi
 | 
			
		||||
    return 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function set_confluent_vars() {
 | 
			
		||||
    if [ -z "$nodename" ]; then
 | 
			
		||||
        nodename=$(grep ^NODENAME: /etc/confluent/confluent.info | awk '{print $2}')
 | 
			
		||||
    fi
 | 
			
		||||
    if [[ "$confluent_mgr" == *"%"* ]]; then
 | 
			
		||||
        confluent_mgr=""
 | 
			
		||||
    fi
 | 
			
		||||
    if [ -z "$confluent_mgr" ]; then
 | 
			
		||||
        confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
        if ! test_mgr $confluent_mgr; then
 | 
			
		||||
            confluent_mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
            if [[ "$confluent_mgr" = *":"* ]]; then
 | 
			
		||||
                confluent_mgr="[$confluent_mgr]"
 | 
			
		||||
            fi
 | 
			
		||||
        fi
 | 
			
		||||
        if ! test_mgr $confluent_mgr; then
 | 
			
		||||
            BESTMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|1$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//')
 | 
			
		||||
            OKMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|0$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//')
 | 
			
		||||
            for confluent_mgr in $BESTMGRS $OKMGRS; do
 | 
			
		||||
                if [[ $confluent_mgr == *":"* ]]; then
 | 
			
		||||
                    confluent_mgr="[$confluent_mgr]"
 | 
			
		||||
                fi
 | 
			
		||||
                if test_mgr $confluent_mgr; then
 | 
			
		||||
                    break
 | 
			
		||||
                fi
 | 
			
		||||
            done
 | 
			
		||||
        fi
 | 
			
		||||
    fi
 | 
			
		||||
    if [ -z "$confluent_profile" ]; then
 | 
			
		||||
        confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,37 @@
 | 
			
		||||
function test_mgr() {
 | 
			
		||||
    if curl -s https://${1}/confluent-api/ > /dev/null; then
 | 
			
		||||
        return 0
 | 
			
		||||
    fi
 | 
			
		||||
    return 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function set_confluent_vars() {
 | 
			
		||||
    if [ -z "$nodename" ]; then
 | 
			
		||||
        nodename=$(grep ^NODENAME: /etc/confluent/confluent.info | awk '{print $2}')
 | 
			
		||||
    fi
 | 
			
		||||
    if [[ "$confluent_mgr" == *"%"* ]]; then
 | 
			
		||||
        confluent_mgr=""
 | 
			
		||||
    fi
 | 
			
		||||
    if [ -z "$confluent_mgr" ]; then
 | 
			
		||||
        confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
        if ! test_mgr $confluent_mgr; then
 | 
			
		||||
            confluent_mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
            if [[ "$confluent_mgr" = *":"* ]]; then
 | 
			
		||||
                confluent_mgr="[$confluent_mgr]"
 | 
			
		||||
            fi
 | 
			
		||||
        fi
 | 
			
		||||
        if ! test_mgr $confluent_mgr; then
 | 
			
		||||
            BESTMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|1$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//')
 | 
			
		||||
            OKMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|0$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//')
 | 
			
		||||
            for confluent_mgr in $BESTMGRS $OKMGRS; do
 | 
			
		||||
                if [[ $confluent_mgr == *":"* ]]; then
 | 
			
		||||
                    confluent_mgr="[$confluent_mgr]"
 | 
			
		||||
                fi
 | 
			
		||||
                if test_mgr $confluent_mgr; then
 | 
			
		||||
                    break
 | 
			
		||||
                fi
 | 
			
		||||
            done
 | 
			
		||||
        fi
 | 
			
		||||
    fi
 | 
			
		||||
    if [ -z "$confluent_profile" ]; then
 | 
			
		||||
        confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,37 @@
 | 
			
		||||
function test_mgr() {
 | 
			
		||||
    if curl -s https://${1}/confluent-api/ > /dev/null; then
 | 
			
		||||
        return 0
 | 
			
		||||
    fi
 | 
			
		||||
    return 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function set_confluent_vars() {
 | 
			
		||||
    if [ -z "$nodename" ]; then
 | 
			
		||||
        nodename=$(grep ^NODENAME: /etc/confluent/confluent.info | awk '{print $2}')
 | 
			
		||||
    fi
 | 
			
		||||
    if [[ "$confluent_mgr" == *"%"* ]]; then
 | 
			
		||||
        confluent_mgr=""
 | 
			
		||||
    fi
 | 
			
		||||
    if [ -z "$confluent_mgr" ]; then
 | 
			
		||||
        confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
        if ! test_mgr $confluent_mgr; then
 | 
			
		||||
            confluent_mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
            if [[ "$confluent_mgr" = *":"* ]]; then
 | 
			
		||||
                confluent_mgr="[$confluent_mgr]"
 | 
			
		||||
            fi
 | 
			
		||||
        fi
 | 
			
		||||
        if ! test_mgr $confluent_mgr; then
 | 
			
		||||
            BESTMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|1$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//')
 | 
			
		||||
            OKMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|0$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//')
 | 
			
		||||
            for confluent_mgr in $BESTMGRS $OKMGRS; do
 | 
			
		||||
                if [[ $confluent_mgr == *":"* ]]; then
 | 
			
		||||
                    confluent_mgr="[$confluent_mgr]"
 | 
			
		||||
                fi
 | 
			
		||||
                if test_mgr $confluent_mgr; then
 | 
			
		||||
                    break
 | 
			
		||||
                fi
 | 
			
		||||
            done
 | 
			
		||||
        fi
 | 
			
		||||
    fi
 | 
			
		||||
    if [ -z "$confluent_profile" ]; then
 | 
			
		||||
        confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,37 @@
 | 
			
		||||
function test_mgr() {
 | 
			
		||||
    if curl -s https://${1}/confluent-api/ > /dev/null; then
 | 
			
		||||
        return 0
 | 
			
		||||
    fi
 | 
			
		||||
    return 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function set_confluent_vars() {
 | 
			
		||||
    if [ -z "$nodename" ]; then
 | 
			
		||||
        nodename=$(grep ^NODENAME: /etc/confluent/confluent.info | awk '{print $2}')
 | 
			
		||||
    fi
 | 
			
		||||
    if [[ "$confluent_mgr" == *"%"* ]]; then
 | 
			
		||||
        confluent_mgr=""
 | 
			
		||||
    fi
 | 
			
		||||
    if [ -z "$confluent_mgr" ]; then
 | 
			
		||||
        confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
        if ! test_mgr $confluent_mgr; then
 | 
			
		||||
            confluent_mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
            if [[ "$confluent_mgr" = *":"* ]]; then
 | 
			
		||||
                confluent_mgr="[$confluent_mgr]"
 | 
			
		||||
            fi
 | 
			
		||||
        fi
 | 
			
		||||
        if ! test_mgr $confluent_mgr; then
 | 
			
		||||
            BESTMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|1$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//')
 | 
			
		||||
            OKMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|0$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//')
 | 
			
		||||
            for confluent_mgr in $BESTMGRS $OKMGRS; do
 | 
			
		||||
                if [[ $confluent_mgr == *":"* ]]; then
 | 
			
		||||
                    confluent_mgr="[$confluent_mgr]"
 | 
			
		||||
                fi
 | 
			
		||||
                if test_mgr $confluent_mgr; then
 | 
			
		||||
                    break
 | 
			
		||||
                fi
 | 
			
		||||
            done
 | 
			
		||||
        fi
 | 
			
		||||
    fi
 | 
			
		||||
    if [ -z "$confluent_profile" ]; then
 | 
			
		||||
        confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,37 @@
 | 
			
		||||
function test_mgr() {
 | 
			
		||||
    if curl -s https://${1}/confluent-api/ > /dev/null; then
 | 
			
		||||
        return 0
 | 
			
		||||
    fi
 | 
			
		||||
    return 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function set_confluent_vars() {
 | 
			
		||||
    if [ -z "$nodename" ]; then
 | 
			
		||||
        nodename=$(grep ^NODENAME: /etc/confluent/confluent.info | awk '{print $2}')
 | 
			
		||||
    fi
 | 
			
		||||
    if [[ "$confluent_mgr" == *"%"* ]]; then
 | 
			
		||||
        confluent_mgr=""
 | 
			
		||||
    fi
 | 
			
		||||
    if [ -z "$confluent_mgr" ]; then
 | 
			
		||||
        confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
        if ! test_mgr $confluent_mgr; then
 | 
			
		||||
            confluent_mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
            if [[ "$confluent_mgr" = *":"* ]]; then
 | 
			
		||||
                confluent_mgr="[$confluent_mgr]"
 | 
			
		||||
            fi
 | 
			
		||||
        fi
 | 
			
		||||
        if ! test_mgr $confluent_mgr; then
 | 
			
		||||
            BESTMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|1$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//')
 | 
			
		||||
            OKMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|0$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//')
 | 
			
		||||
            for confluent_mgr in $BESTMGRS $OKMGRS; do
 | 
			
		||||
                if [[ $confluent_mgr == *":"* ]]; then
 | 
			
		||||
                    confluent_mgr="[$confluent_mgr]"
 | 
			
		||||
                fi
 | 
			
		||||
                if test_mgr $confluent_mgr; then
 | 
			
		||||
                    break
 | 
			
		||||
                fi
 | 
			
		||||
            done
 | 
			
		||||
        fi
 | 
			
		||||
    fi
 | 
			
		||||
    if [ -z "$confluent_profile" ]; then
 | 
			
		||||
        confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user