diff --git a/agent-install/agent-uninstall.sh b/agent-install/agent-uninstall.sh old mode 100644 new mode 100755 index f265322c9..f9b13aeb3 --- a/agent-install/agent-uninstall.sh +++ b/agent-install/agent-uninstall.sh @@ -18,10 +18,6 @@ SKIP_DELETE_AGENT_NAMESPACE=false USE_DELETE_FORCE=false DELETE_TIMEOUT=10 # Default delete timeout -function now() { - echo `date '+%Y-%m-%d %H:%M:%S'` -} - # Exit handling function quit(){ case $1 in @@ -215,7 +211,7 @@ function get_agent_pod_id() { fi if [ "$AGENT_POD_READY" == "true" ]; then - POD_ID=$($KUBECTL get pod -n ${AGENT_NAMESPACE} 2> /dev/null | grep "agent-" | cut -d " " -f1 2> /dev/null) + POD_ID=$($KUBECTL get pod -n ${AGENT_NAMESPACE} -l app=agent,type!=auto-upgrade-cronjob 2> /dev/null | grep "agent-" | cut -d " " -f1 2> /dev/null) if [ -n "${POD_ID}" ]; then log_info "get pod: ${POD_ID}" else @@ -287,8 +283,9 @@ function unregister() { log_debug "unregister() end" } +# escape: ;, $, &, |, (, ) function getEscapedExchangeUserAuth() { - local escaped_auth=$( echo "${HZN_EXCHANGE_USER_AUTH}" | sed 's/;/\\;/g;s/\$/\\$/g;s/\&/\\&/g;s/|/\\|/g' ) + local escaped_auth=$( echo "${HZN_EXCHANGE_USER_AUTH}" | sed 's/;/\\;/g;s/\$/\\$/g;s/\&/\\&/g;s/|/\\|/g;s/(/\\(/g;s/)/\\)/g' ) echo "${escaped_auth}" }