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