Archived
1
0

Add startall and stopall

This commit is contained in:
2025-08-24 19:36:55 +02:00
parent 1dfd3f090f
commit 759e7412c3
2 changed files with 20 additions and 2 deletions

View File

@@ -9,6 +9,8 @@ function showHelp() {
echo " status"
echo " start profile|port target"
echo " stop port"
echo " startall"
echo " stopall"
echo "cmd_args :"
echo " profile Name of the profile (~/.config/ssh-proxy/*)"
echo " port Proxy local port (1024-65535)"
@@ -151,9 +153,25 @@ function stopProxy() {
rm "${TMP_FILE}"
}
function startAll() {
for FILE in ~/.config/ssh-proxy/*; do
PROFILE=$(basename "${FILE}")
startProxy "${PROFILE}"
done
}
function stopAll() {
for FILE in /tmp/ssh-proxy-"${USER}"/*; do
PORT=$(basename "${FILE}")
stopProxy "${PORT}"
done
}
case ${1} in
"status") showProxyStatus;;
"start") startProxy "${2}" "${3}";;
"stop") stopProxy "${2}";;
"startall") startAll;;
"stopall") stopAll;;
*) exit 1;;
esac