SQL Proxy: Fix issue with host list

This commit is contained in:
Kevin Baensch 2022-11-17 15:46:38 +01:00
parent 0cb7e70a68
commit d6250457e2
2 changed files with 3 additions and 3 deletions

View file

@ -48,7 +48,7 @@ port_forward() {
} }
ls_hosts() { ls_hosts() {
echo $(ssh -S $HOME/.ssh/controlmasters/%r@%h:%p $SQL_PROXY_HOST ls) ssh -S $HOME/.ssh/controlmasters/%r@%h:%p $SQL_PROXY_HOST ls
} }
run_client() { run_client() {
@ -89,7 +89,7 @@ case $MAIN_OPTION in
run_client $MYSQL_USERNAME $MYSQL_PASSWORD run_client $MYSQL_USERNAME $MYSQL_PASSWORD
fi fi
else else
echo "Invalid Hostname: $2." echo "Invalid Hostname: $TARGET_HOST."
fi fi
;; ;;
disconnect) disconnect)

View file

@ -2,7 +2,7 @@
ls_hosts() { ls_hosts() {
# the containers version of grep does not support perl regex so "[^ ]*(?= # Added by hostman)" does not work # the containers version of grep does not support perl regex so "[^ ]*(?= # Added by hostman)" does not work
echo $(grep -e "# Added by hostman" /etc/hosts | grep -oe "^[^ ]* [^ ]*" | grep -oe "[^ ]*$") grep -e "# Added by hostman" /etc/hosts | grep -oe "^[^ ]* [^ ]*" | grep -oe "[^ ]*$"
} }
idle() { idle() {