diff options
| author | cvs2svn <admin@example.com> | 1999-03-26 18:24:03 +0000 |
|---|---|---|
| committer | cvs2svn <admin@example.com> | 1999-03-26 18:24:03 +0000 |
| commit | 3fc228fb4c1a39aceaee3d7013365042a6077bd0 (patch) | |
| tree | af769f6648929b3b2c1f9e053a3754fa989ce302 /src/usr.bin/nc/scripts/bsh | |
| parent | 536c76cbb863bab152f19842ab88772c01e922c7 (diff) | |
| download | openbsd-3fc228fb4c1a39aceaee3d7013365042a6077bd0.tar.gz openbsd-3fc228fb4c1a39aceaee3d7013365042a6077bd0.tar.bz2 openbsd-3fc228fb4c1a39aceaee3d7013365042a6077bd0.zip | |
This commit was manufactured by cvs2git to create branch 'OPENBSD_2_5'.OPENBSD_2_5
Diffstat (limited to 'src/usr.bin/nc/scripts/bsh')
| -rw-r--r-- | src/usr.bin/nc/scripts/bsh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/usr.bin/nc/scripts/bsh b/src/usr.bin/nc/scripts/bsh new file mode 100644 index 0000000000..796e480354 --- /dev/null +++ b/src/usr.bin/nc/scripts/bsh | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | #! /bin/sh | ||
| 2 | ## a little wrapper to "password" and re-launch a shell-listener. | ||
| 3 | ## Arg is taken as the port to listen on. Define "NC" to point wherever. | ||
| 4 | |||
| 5 | NC=nc | ||
| 6 | |||
| 7 | case "$1" in | ||
| 8 | ?* ) | ||
| 9 | LPN="$1" | ||
| 10 | export LPN | ||
| 11 | sleep 1 | ||
| 12 | echo "-l -p $LPN -e $0" | $NC > /dev/null 2>&1 & | ||
| 13 | echo "launched on port $LPN" | ||
| 14 | exit 0 | ||
| 15 | ;; | ||
| 16 | esac | ||
| 17 | |||
| 18 | # here we play inetd | ||
| 19 | echo "-l -p $LPN -e $0" | $NC > /dev/null 2>&1 & | ||
| 20 | |||
| 21 | while read qq ; do | ||
| 22 | case "$qq" in | ||
| 23 | # here's yer password | ||
| 24 | gimme ) | ||
| 25 | cd / | ||
| 26 | exec csh -i | ||
| 27 | ;; | ||
| 28 | esac | ||
| 29 | done | ||
