bootstrap master
authorshort <>
Wed, 8 Oct 2003 10:28:35 +0000 (10:28 +0000)
committershort <>
Wed, 8 Oct 2003 10:28:35 +0000 (10:28 +0000)
hostintranet/etc-inittab [new file with mode: 0644]
hostintranet/hostintranet-ssht.pl [new file with mode: 0755]
hostintranet/public.internet.com--hostintranet-ssht [new file with mode: 0755]
hostintranet/public.internet.com--hostintranet-ssht--identity [new file with mode: 0644]
public.internet.com/etc-passwd [new file with mode: 0644]
public.internet.com/home-hostintranet-ssht/.ssh/authorized_keys [new file with mode: 0644]
public.internet.com/home-hostintranet-ssht/hostintranet-ssht.log [new file with mode: 0644]
public.internet.com/home-hostintranet-ssht/hostintranet-ssht.pl [new file with mode: 0755]

diff --git a/hostintranet/etc-inittab b/hostintranet/etc-inittab
new file mode 100644 (file)
index 0000000..70dd759
--- /dev/null
@@ -0,0 +1 @@
+gw:2345:respawn:/root/public.internet.com--hostintranet-ssht
diff --git a/hostintranet/hostintranet-ssht.pl b/hostintranet/hostintranet-ssht.pl
new file mode 100755 (executable)
index 0000000..c5e42a9
--- /dev/null
@@ -0,0 +1,55 @@
+#! /usr/bin/perl -Tw --
+
+use strict;
+#use warnings; #-w
+
+use constant LOGFNAME=>"/root/hostintranet-ssht-out.log";
+
+open LOG,">>".LOGFNAME
+       or die "append: ".LOGFNAME;
+my $stdout=select();
+$|=1;
+select LOG;
+$|=1;
+select $stdout;
+
+my($nulldev ,$nullinode )=stat "/dev/null";
+my($stdindev,$stdininode)=stat STDIN;
+my $isnull=($nulldev==$stdindev && $nullinode==$stdininode);
+
+sub out
+{
+my($msg)=@_;
+
+       $msg="$$: $msg\n";
+       print LOG $msg;
+       print $msg;
+}
+
+sub outdie
+{
+my($msg)=@_;
+
+       out $msg;
+       die $msg;
+}
+
+out "CONNECT";
+for (;;) {
+       out scalar localtime(time());
+
+       my $tmo=60;
+       while ($tmo-->0) {
+               sleep 1;
+               next if $isnull;
+
+               my $rfds="";
+               vec($rfds,fileno(STDIN),1)=1;
+               my $efds=$rfds;
+               next if 1!=select $rfds,undef,$efds,0;
+               my $got;
+               outdie "expectfds" if vec($efds,fileno(STDIN),1);
+               my $sysread;
+               outdie "sysread=$sysread" if 1!=($sysread=sysread STDIN,$got,1);
+               }
+       }
diff --git a/hostintranet/public.internet.com--hostintranet-ssht b/hostintranet/public.internet.com--hostintranet-ssht
new file mode 100755 (executable)
index 0000000..13c5887
--- /dev/null
@@ -0,0 +1,4 @@
+#! /bin/sh
+/root/hostintranet-ssht.pl </dev/null | \
+       /usr/bin/ssh -1 -i /root/public.internet.com--hostintranet-ssht--identity -R 8001:localhost:22 hostintranet-ssht@1.2.3.4-IP-of-public.internet.com \
+                       >> /root/hostintranet-ssht-in.log 2>&1
diff --git a/hostintranet/public.internet.com--hostintranet-ssht--identity b/hostintranet/public.internet.com--hostintranet-ssht--identity
new file mode 100644 (file)
index 0000000..3622492
--- /dev/null
@@ -0,0 +1 @@
+private key from ~/.ssh/id_dsa
diff --git a/public.internet.com/etc-passwd b/public.internet.com/etc-passwd
new file mode 100644 (file)
index 0000000..d4fe57f
--- /dev/null
@@ -0,0 +1 @@
+hostintranet-ssht:x:1006:1006:hostintranet ssht:/home/hostintranet-ssht:/home/hostintranet-ssht/hostintranet-ssht.pl
diff --git a/public.internet.com/home-hostintranet-ssht/.ssh/authorized_keys b/public.internet.com/home-hostintranet-ssht/.ssh/authorized_keys
new file mode 100644 (file)
index 0000000..c6e87f5
--- /dev/null
@@ -0,0 +1 @@
+public key from ~/.ssh/id_dsa.pub
diff --git a/public.internet.com/home-hostintranet-ssht/hostintranet-ssht.log b/public.internet.com/home-hostintranet-ssht/hostintranet-ssht.log
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/public.internet.com/home-hostintranet-ssht/hostintranet-ssht.pl b/public.internet.com/home-hostintranet-ssht/hostintranet-ssht.pl
new file mode 100755 (executable)
index 0000000..e29f516
--- /dev/null
@@ -0,0 +1,55 @@
+#! /usr/bin/perl -Tw --
+
+use strict;
+#use warnings; #-w
+
+use constant LOGFNAME=>"/home/hostintranet-ssht/hostintranet-ssht.log";
+
+open LOG,">>".LOGFNAME
+       or die "append: ".LOGFNAME;
+my $stdout=select();
+$|=1;
+select LOG;
+$|=1;
+select $stdout;
+
+my($nulldev ,$nullinode )=stat "/dev/null";
+my($stdindev,$stdininode)=stat STDIN;
+my $isnull=($nulldev==$stdindev && $nullinode==$stdininode);
+
+sub out
+{
+my($msg)=@_;
+
+       $msg="$$: $msg\n";
+       print LOG $msg;
+       print $msg;
+}
+
+sub outdie
+{
+my($msg)=@_;
+
+       out $msg;
+       die $msg;
+}
+
+out "CONNECT";
+for (;;) {
+       out scalar localtime(time());
+
+       my $tmo=60;
+       while ($tmo-->0) {
+               sleep 1;
+               next if $isnull;
+
+               my $rfds="";
+               vec($rfds,fileno(STDIN),1)=1;
+               my $efds=$rfds;
+               next if 1!=select $rfds,undef,$efds,0;
+               my $got;
+               outdie "expectfds" if vec($efds,fileno(STDIN),1);
+               my $sysread;
+               outdie "sysread=$sysread" if 1!=($sysread=sysread STDIN,$got,1);
+               }
+       }