From 1dfd3f090f467f4187512f255aba76183ae567dd Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sun, 24 Aug 2025 05:08:13 +0200 Subject: [PATCH] Add status command --- bin/ssh-proxy | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/ssh-proxy b/bin/ssh-proxy index 70afb86..56c1b74 100755 --- a/bin/ssh-proxy +++ b/bin/ssh-proxy @@ -38,15 +38,15 @@ case ${1} in esac function showProxyStatus() { - echo -e "Port\tProxy" - if [ -d /tmp/ssh-proxy-"${USER}" ]; then - if [ "$(find /tmp/ssh-proxy-"${USER}" -maxdepth 0 -empty -exec echo 1 \;)" == "" ]; then - for FILE in /tmp/ssh-proxy-"${USER}"/*; do - PORT=$(basename "${FILE}") - PROXY=$(grep 'PROXY=' "${FILE}" | sed 's/PROXY=//') - echo -e "${PORT}\t${PROXY}" - done - fi + if [ -d /tmp/ssh-proxy-"${USER}" ] && [ "$(find /tmp/ssh-proxy-"${USER}" -maxdepth 0 -empty -exec echo 1 \;)" == "" ]; then + echo -e "Port\tProxy" + for FILE in /tmp/ssh-proxy-"${USER}"/*; do + PORT=$(basename "${FILE}") + PROXY=$(grep 'PROXY=' "${FILE}" | sed 's/PROXY=//') + echo -e "${PORT}\t${PROXY}" + done + else + echo "No open proxy" fi }