Files
my_dotfiles/script/proxy.sh-22
Hu.Nan 0fe8dd22e2 Signed-off-by: Hu.Nan <nhu@linx-info.com>
新文件:   script/proxy.sh-22
2021-11-18 15:56:57 +08:00

20 lines
526 B
Plaintext
Executable File

#!/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" }
}
}