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" } + } +}