From 4b202699de3102360531f7c5152736319b8acf28 Mon Sep 17 00:00:00 2001 From: Sense T Date: Mon, 10 Mar 2025 09:44:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Esftp=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qzsec/access-client/access-client | 33 +++++++++++++++++++------------ 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/qzsec/access-client/access-client b/qzsec/access-client/access-client index adb1e1c..a0e8fbf 100644 --- a/qzsec/access-client/access-client +++ b/qzsec/access-client/access-client @@ -25,19 +25,26 @@ fi ARGS=$(echo $URL | sed 's|accessclient://||' | base64 -d | minideflate -d ) APP=$(echo $ARGS | jq -r .app) -if [ "$APP" != "putty" ]; then - echo "Unsupported app, should be putty." +if [ "$APP" == "putty" ]; then + TITLE=$(echo $ARGS | jq -r .st) + HOSTNAME=$(echo $ARGS | jq -r .hn) + PORT_NUM=$(echo $ARGS | jq -r .pn) + USERNAME=$(echo $ARGS | jq -r .un) + PASSWORD=$(echo $ARGS | jq -r .pw) + echo "Will connect to $TITLE..." + xdg-terminal-exec passh -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o HostKeyAlgorithms=+ssh-rsa -p $PORT_NUM $USERNAME@$HOSTNAME +elif [ "$APP" == "filezilla" ]; then + TITLE=$(echo $ARGS | jq -r .st) + HOSTNAME=$(echo $ARGS | jq -r .Host) + PORT_NUM=$(echo $ARGS | jq -r .Port) + USERNAME=$(echo $ARGS | jq -r .User) + PASSWORD=$(echo $ARGS | jq -r .PWD) + + filebinary=$(which org.filezillaproject.Filezilla || which filezilla ) + + "$filebinary" "sftp://$USERNAME:$PASSWORD@$HOSTNAME:$PORT_NUM" +else + echo "Unsupported app." sleep 5 exit 1 fi - -HOSTNAME=$(echo $ARGS | jq -r .hn) -PORT_NUM=$(echo $ARGS | jq -r .pn) -USERNAME=$(echo $ARGS | jq -r .un) -PASSWORD=$(echo $ARGS | jq -r .pw) - -TITLE=$(echo $ARGS | jq -r .st) - -echo "Will connect to $TITLE..." - -xdg-terminal-exec passh -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o HostKeyAlgorithms=+ssh-rsa -p $PORT_NUM $USERNAME@$HOSTNAME \ No newline at end of file