From 98542abb36b2cc52b93bf5c1028f517367d3f133 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sun, 24 Aug 2025 05:05:02 +0200 Subject: [PATCH] Add status command --- bin/ssh-proxy | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/bin/ssh-proxy b/bin/ssh-proxy index 2473cbc..70afb86 100755 --- a/bin/ssh-proxy +++ b/bin/ssh-proxy @@ -39,12 +39,15 @@ esac function showProxyStatus() { echo -e "Port\tProxy" - echo "" - for FILE in /tmp/ssh-proxy-"${USER}"/*; do - PORT=$(basename "${FILE}") - PROXY=$(grep 'PROXY=' "${FILE}" | sed 's/PROXY=//') - echo -e "${PORT}\t${PROXY}" - done + 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 + fi } function startProxy() {