6a9de42
diff -ru bandwidthd-2.0.1/bandwidthd.c bandwidthd-2.0.1.new/bandwidthd.c
6a9de42
--- bandwidthd-2.0.1/bandwidthd.c	2005-01-11 22:27:26.000000000 +0100
6a9de42
+++ bandwidthd-2.0.1.new/bandwidthd.c	2005-06-19 03:23:49.000000000 +0200
6a9de42
@@ -255,22 +255,29 @@
6a9de42
 
6a9de42
 	openlog("bandwidthd", LOG_CONS, LOG_DAEMON);
6a9de42
 
6a9de42
-	if (stat("./etc/bandwidthd.conf", &StatBuf))
6a9de42
+	if (stat("/etc/bandwidthd.conf", &StatBuf))
6a9de42
 		{
6a9de42
 		chdir(INSTALL_DIR);
6a9de42
 		if (stat("./etc/bandwidthd.conf", &StatBuf))
6a9de42
 			{
6a9de42
-			printf("Cannot find ./etc/bandwidthd.conf or %s/etc/bandwidthd.conf\n", INSTALL_DIR);
6a9de42
-			syslog(LOG_ERR, "Cannot find ./etc/bandwidthd.conf or %s/etc/bandwidthd.conf", INSTALL_DIR);
6a9de42
+			printf("Cannot find /etc/bandwidthd.conf or %s/etc/bandwidthd.conf\n", INSTALL_DIR);
6a9de42
+			syslog(LOG_ERR, "Cannot find /etc/bandwidthd.conf or %s/etc/bandwidthd.conf", INSTALL_DIR);
6a9de42
 			exit(1);
6a9de42
 			}
6a9de42
+		else
6a9de42
+		        {
6a9de42
+		        bdconfig_in = fopen("./etc/bandwidthd.conf", "rt");
6a9de42
+                        }	
6a9de42
 		}
6a9de42
-
6a9de42
-	bdconfig_in = fopen("./etc/bandwidthd.conf", "rt");
6a9de42
+	else
6a9de42
+	        {
6a9de42
+			bdconfig_in = fopen("/etc/bandwidthd.conf", "rt");
6a9de42
+		}
6a9de42
+		
6a9de42
 	if (!bdconfig_in)
6a9de42
 		{
6a9de42
 		syslog(LOG_ERR, "Cannot open bandwidthd.conf");
6a9de42
-		printf("Cannot open ./etc/bandwidthd.conf\n");
6a9de42
+		printf("Cannot open bandwidthd.conf\n");
6a9de42
 		exit(1);
6a9de42
 		}
6a9de42
 	bdconfig_parse();
6a9de42
@@ -290,6 +297,7 @@
6a9de42
 		(unsigned long) (0-1), (unsigned long long) (0-1));
6a9de42
 		exit(1);
6a9de42
 	*/
6a9de42
+	chdir(INSTALL_DIR);
6a9de42
 
6a9de42
 	for(Counter = 1; Counter < argc; Counter++)
6a9de42
 		{
6a9de42
diff -ru bandwidthd-2.0.1/bandwidthd.h bandwidthd-2.0.1.new/bandwidthd.h
6a9de42
--- bandwidthd-2.0.1/bandwidthd.h	2005-01-11 22:15:49.000000000 +0100
6a9de42
+++ bandwidthd-2.0.1.new/bandwidthd.h	2005-06-19 03:22:21.000000000 +0200
6a9de42
@@ -100,6 +100,7 @@
6a9de42
 
6a9de42
 #define DB_PGSQL 1
6a9de42
 
6a9de42
+
6a9de42
 struct config
6a9de42
 	{
6a9de42
 	char *dev;
6a9de42
Only in bandwidthd-2.0.1.new/etc: bandwidthd.conf.orig
6a9de42
Only in bandwidthd-2.0.1.new/etc: bandwidthd.conf.rej
6a9de42
diff -ru bandwidthd-2.0.1/Makefile.in bandwidthd-2.0.1.new/Makefile.in
6a9de42
--- bandwidthd-2.0.1/Makefile.in	2005-01-11 22:15:49.000000000 +0100
6a9de42
+++ bandwidthd-2.0.1.new/Makefile.in	2005-06-19 03:32:37.000000000 +0200
6a9de42
@@ -1,10 +1,13 @@
6a9de42
 exec_prefix = @exec_prefix@
6a9de42
 prefix = @prefix@
6a9de42
+datadir = @datadir@
6a9de42
+sbindir = @sbindir@
6a9de42
+
6a9de42
 CC = @CC@
6a9de42
 LDFLAGS = @LDFLAGS@ @LIBS@
6a9de42
 OBS= bandwidthd.o graph.o conf.tab.o conf.l.o
6a9de42
 
6a9de42
-CFLAGS= -Wall @CFLAGS@ @CPPFLAGS@ @DEFS@ -DINSTALL_DIR="\"$(exec_prefix)/bandwidthd\""
6a9de42
+CFLAGS= -Wall @CFLAGS@ @CPPFLAGS@ @DEFS@ -DINSTALL_DIR="\"$(datadir)/bandwidthd\""
6a9de42
 NONWALLCFLAGS= @CFLAGS@ @CPPFLAGS@ @DEFS@
6a9de42
 
6a9de42
 # Debugging stuff
6a9de42
@@ -38,12 +41,13 @@
6a9de42
 	rm -f conf.tab.c conf.tab.h conf.l.c config.h.in configure 
6a9de42
 
6a9de42
 install: all
6a9de42
-	@INSTALL@ -d $(DESTDIR)$(exec_prefix)/bandwidthd/etc
6a9de42
-	@INSTALL@ -d $(DESTDIR)$(exec_prefix)/bandwidthd/htdocs
6a9de42
-	@INSTALL@ -m755 -s bandwidthd $(DESTDIR)$(exec_prefix)/bandwidthd	
6a9de42
-	if [ ! -f $(DESTDIR)$(exec_prefix)/bandwidthd/etc/bandwidthd.conf ] ; then @INSTALL@ -m644 etc/bandwidthd.conf $(DESTDIR)$(exec_prefix)/bandwidthd/etc/ ; fi
6a9de42
-	@INSTALL@ -m644 htdocs/legend.gif $(DESTDIR)$(exec_prefix)/bandwidthd/htdocs
6a9de42
-	@INSTALL@ -m644 htdocs/logo.gif $(DESTDIR)$(exec_prefix)/bandwidthd/htdocs
6a9de42
+	@INSTALL@ -d $(DESTDIR)/etc
6a9de42
+	@INSTALL@ -d $(DESTDIR)$(datadir)/bandwidthd/htdocs
6a9de42
+	@INSTALL@ -d $(DESTDIR)$(sbindir)	
6a9de42
+	@INSTALL@ -m755 bandwidthd $(DESTDIR)$(sbindir)/bandwidthd	
6a9de42
+	if [ ! -f $(DESTDIR)/etc/bandwidthd.conf ] ; then @INSTALL@ -m644 etc/bandwidthd.conf $(DESTDIR)/etc/ ; fi
6a9de42
+	@INSTALL@ -m644 htdocs/legend.gif $(DESTDIR)$(datadir)/bandwidthd/htdocs
6a9de42
+	@INSTALL@ -m644 htdocs/logo.gif $(DESTDIR)$(datadir)/bandwidthd/htdocs
6a9de42
 
6a9de42
 #**** Stuff where -WALL is turned off to reduce the noise in a compile so I can see my own errors *******************
6a9de42
 conf.l.o: conf.l.c