From 0fe8dd22e2fc6745741aad8fc21a4d937bdc1044 Mon Sep 17 00:00:00 2001 From: "Hu.Nan" Date: Thu, 18 Nov 2021 15:56:57 +0800 Subject: [PATCH] Signed-off-by: Hu.Nan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新文件: script/proxy.sh-22 --- script/proxy.sh-22 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 script/proxy.sh-22 diff --git a/script/proxy.sh-22 b/script/proxy.sh-22 new file mode 100755 index 0000000..24fe522 --- /dev/null +++ b/script/proxy.sh-22 @@ -0,0 +1,19 @@ +#!/usr/bin/expect -f + +set IPandPort "0.0.0.0:2080" +#set username "root" +set username "zhang" +#set remoteHost "104.224.157.48" +set remoteHost "172.20.20.22" +set password "zhang" +set rport "7001" +set timeout -1 +#autossh -M 1111 -p 20002 -N -D 0.0.0.0:1080 root@104.224.157.48 +spawn autossh -M 1122 -p $rport -N -D $IPandPort $username@$remoteHost + +while true { + expect { + "(yes/no)" { send "yes\r"; exp_continue } + "assword:" { send "$password\r"; puts \r;set DATE [exec date "+%F %H:%M:%S"]; puts "$DATE\r" } + } +} -- 2.49.1