summaryrefslogtreecommitdiff
path: root/nocompile/libexec/telnet-gateway.sh
blob: 5b98cdeeb5e8fbfe9e7ae82bfc30d3193e2f1674 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
export PATH=$PATH:/usr/local/bin:/usr/pkg/bin
export CUTURL_PORT=23

grep "^telnet:" /var/www/sites/hacking/links.txt \
 | cat -n
printf "Which do you want to connect to?\nnumber: "
read N
export N=$(printf "%s" "$N" | sed "s/[^0-9]//g")
serverURL=$(grep "^telnet:" /var/www/sites/hacking/links.txt \
 | cut '-d ' -f1 \
 | head -n${N} \
 | tail -n1)
echo "You've selected: $serverURL (#$N)"
printf "connecting in...\n"
#for i in `seq 5 1`;do
# printf "\r%d..." $i
# sleep 1
#done
port=$(printf "%s" "$serverURL" | cuturl --port)
#yes ncat. I *really* meant 10 minutes. why force me to use ms for that?
exec ncat -i 600000ms $(printf "%s" "$serverURL" | cuturl --domain ) $port