diff options
author | Nick Kralevich <nnk@google.com> | 2011-10-24 15:44:27 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2011-10-24 16:45:58 -0700 |
commit | e4e83f8147f92141cd02cc46cccca088c527ea2a (patch) | |
tree | c6447c33a54750c3c51d062d023e0c84ee788e9b /scripts/irc | |
parent | 3b92542cff3f53ab608c25e1f65c538e42dece1b (diff) | |
download | netcat-e4e83f8147f92141cd02cc46cccca088c527ea2a.tar.gz |
Upgrade to openbsd's netcat.android-cts-4.2_r1android-4.2_r1android-4.2.2_r1.2android-4.2.2_r1.1android-4.2.2_r1android-4.2.1_r1.2android-4.2.1_r1.1android-4.2.1_r1android-4.1.2_r2.1android-4.1.2_r2android-4.1.2_r1android-4.1.1_r6.1android-4.1.1_r6android-4.1.1_r5android-4.1.1_r4android-4.1.1_r3android-4.1.1_r2android-4.1.1_r1.1android-4.1.1_r1jb-releasejb-mr1.1-releasejb-mr1-releasejb-mr0-release
Upgrade to openbsd's version of netcat, available for download
from http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
This version has been modified to remove BSD specific calls
and other functionality unnecessary for Android. The removed
portions of code are surrounded by #ifdef ANDROID / #endif.
This code corresponds to the following openbsd versions:
atomicio.c: v1.10
atomicio.h: v1.2
netcat.c: v1.103
The file socks.c and nc.1 are not included in this change.
Change-Id: I39df7fbe335af97e092dd4d4a96f957d6d1a5b5d
Diffstat (limited to 'scripts/irc')
-rwxr-xr-x | scripts/irc | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/scripts/irc b/scripts/irc deleted file mode 100755 index 3557d7a..0000000 --- a/scripts/irc +++ /dev/null @@ -1,79 +0,0 @@ -#! /bin/sh -## Shit-simple script to supply the "privmsg <recipient>" of IRC typein, and -## keep the connection alive. Pipe this thru "nc -v -w 5 irc-server port". -## Note that this mechanism makes the script easy to debug without being live, -## since it just echoes everything bound for the server. -## if you want autologin-type stuff, construct some appropriate files and -## shovel them in using the "<" mechanism. - -# magic arg: if "tick", do keepalive process instead of main loop -if test "$1" = "tick" ; then -# ignore most signals; the parent will nuke the kid -# doesn't stop ^Z, of course. - trap '' 1 2 3 13 14 15 16 - while true ; do - sleep 60 - echo "PONG !" - done -fi - -# top level: fire ourselves off as the keepalive process, and keep track of it -sh $0 tick & -ircpp=$! -echo "[Keepalive: $ircpp]" >&2 -# catch our own batch of signals: hup int quit pipe alrm term urg -trap 'kill -9 $ircpp ; exit 0' 1 2 3 13 14 15 16 -sleep 2 - -sender='' -savecmd='' - -# the big honkin' loop... -while read xx yy ; do - case "${xx}" in -# blank line: do nothing - "") - continue - ;; -# new channel or recipient; if bare ">", we're back to raw literal mode. - ">") - if test "${yy}" ; then - sender="privmsg ${yy} :" - else - sender='' - fi - continue - ;; -# send crud from a file, one line per second. Can you say "skr1pt kidz"?? -# *Note: uses current "recipient" if set. - "<") - if test -f "${yy}" ; then - ( while read zz ; do - sleep 1 - echo "${sender}${zz}" - done ) < "$yy" - echo "[done]" >&2 - else - echo "[File $yy not found]" >&2 - fi - continue - ;; -# do and save a single command, for quick repeat - "/") - if test "${yy}" ; then - savecmd="${yy}" - fi - echo "${savecmd}" - ;; -# default case goes to recipient, just like always - *) - echo "${sender}${xx} ${yy}" - continue - ;; - esac -done - -# parting shot, if you want it -echo "quit :Bye all!" -kill -9 $ircpp -exit 0 |