From f3e3ab0158f1592a3a974b9acbab308daf5e9c56 Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Tue, 12 Dec 2006 14:18:06 +0000 Subject: print the hostname in the HTML title. --- usr.bin/bgplg/bgplg.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/bgplg/bgplg.c b/usr.bin/bgplg/bgplg.c index 489df8dbfcf..766de682dea 100644 --- a/usr.bin/bgplg/bgplg.c +++ b/usr.bin/bgplg/bgplg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgplg.c,v 1.3 2006/12/12 11:43:50 reyk Exp $ */ +/* $OpenBSD: bgplg.c,v 1.4 2006/12/12 14:18:05 reyk Exp $ */ /* * Copyright (c) 2005, 2006 Reyk Floeter @@ -39,6 +39,7 @@ #define BGPCTL "/bin/bgpctl", "-s", BGPDSOCK #define PING "/bin/ping" #define TRACEROUTE "/bin/traceroute" +#define CONTENT_TYPE "text/html" static struct cmd cmds[] = CMDS; @@ -249,14 +250,18 @@ main(void) u_int i; struct cmd *cmdp = NULL; - printf("Content-Type: text/html\n" + if (gethostname(myname, sizeof(myname)) != 0) + return (1); + + printf("Content-Type: %s\n" "Cache-Control: no-cache\n\n" "\n" "\n" "\n" "\n" - "bgplg\n"); + "%s: %s\n", + CONTENT_TYPE, NAME, myname); if (stat(INC_STYLE, &st) == 0) { printf("