summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2007-02-14 16:44:04 +0000
committerDimitri Sokolyuk <demon@dim13.org>2007-02-14 16:44:04 +0000
commit822c17da7bdf13f71e72b62eddd99688eaea033c (patch)
tree70353db94ec155b9372e52401761ad214a18f7f3
parentbee0f8f7527e4a48eb32422d6021d7cf2bd49b86 (diff)
remote addr
-rw-r--r--ip/Makefile8
-rw-r--r--ip/ip.c17
2 files changed, 25 insertions, 0 deletions
diff --git a/ip/Makefile b/ip/Makefile
new file mode 100644
index 0000000..4256be9
--- /dev/null
+++ b/ip/Makefile
@@ -0,0 +1,8 @@
+# $Id$
+
+PROG= ip
+CFLAGS+= -Wall
+NOMAN=
+BINDIR= /var/www/cgi-bin
+
+.include <bsd.prog.mk>
diff --git a/ip/ip.c b/ip/ip.c
new file mode 100644
index 0000000..fd68cf4
--- /dev/null
+++ b/ip/ip.c
@@ -0,0 +1,17 @@
+/* $Id$ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main()
+{
+ char *ra;
+
+ printf("Content-type: %s\r\n\r\n", "text/plain");
+
+ if (ra = getenv("REMOTE_ADDR"))
+ printf("%s\n", ra);
+
+ return 0;
+}