Archived
1
0

Add status command

This commit is contained in:
MatMoul 2025-08-24 05:08:13 +02:00
parent 98542abb36
commit 1dfd3f090f

View File

@ -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
}