diff options
author | toni <matzeton@googlemail.com> | 2016-07-12 14:58:42 +0200 |
---|---|---|
committer | toni <matzeton@googlemail.com> | 2016-07-12 14:58:42 +0200 |
commit | d89d3bd711823a20b4d15fbec375dc035f998788 (patch) | |
tree | 5f5fb13bbb0d3fb0fc45ac96d32ee331e60e088e /irssi-tor.sh | |
parent | 316a392e3cc9a454f6b5f0f8e9ac2f8c798ccd35 (diff) |
irssi ircs not supported from command line :/
Diffstat (limited to 'irssi-tor.sh')
-rwxr-xr-x | irssi-tor.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/irssi-tor.sh b/irssi-tor.sh index 742d577..b9d2a5b 100755 --- a/irssi-tor.sh +++ b/irssi-tor.sh @@ -8,7 +8,7 @@ while `netstat -l4n | grep -qoE "^tcp(.*):${SOC_PORT}"`; do SOC_PORT=${NEXT_PORT} done -if [ $# -ne 3 ]; then +if [ $# -ne 3 ] && [ $# -ne 0 ]; then echo "$0: [IRC_HOST] [IRC_PORT] [IRC_NICK]" exit 1 fi @@ -17,10 +17,14 @@ IRC_PORT="$2" IRC_NICK="$3" sudo iptables -A INPUT -p tcp '!' -s 127.0.0.1 --dport ${SOC_PORT} -j REJECT -socat TCP4-LISTEN:${SOC_PORT},reuseaddr,range=127.0.0.1/32 SOCKS4A:localhost:${IRC_HOST}:${IRC_PORT},socksport=9050 & +socat -d -d -lmlocal2 TCP4-LISTEN:${SOC_PORT},reuseaddr,fork,range=127.0.0.1/32 SOCKS4A:localhost:${IRC_HOST}:${IRC_PORT},socksport=9050 & SOC_PID=$! echo "socat pid ${SOC_PID}" -irssi -c localhost -p ${SOC_PORT} -n ${IRC_NICK} +if [ $# -eq 0 ]; then + irssi --noconnect +else + irssi -c localhost -p ${SOC_PORT} -n ${IRC_NICK} +fi echo "kill ${SOC_PID}" kill -SIGTERM ${SOC_PID} 2>/dev/null wait ${SOC_PID} |