Seems the method of finding nedi.conf is different in diffrent sections of nedi
It should be, in search order
* start directory for nedi.pl nedi/nedi.conf
* ln to nedi.conf for phps html/nedi.conf (this is bad as one can see passwords)
* better maybe to get index.php directory and .. back (../nedi.conf don't work ?)
* /var/nedi/nedi.conf
* /etc/nedi.conf
A better ../nedi.conf for php
| CODE |
function ReadConf($group) {
//Hej: I'm no programmer .. $sfn="$_SERVER[SCRIPT_FILENAME]"; $pos=strrpos($sfn,'/'); $sfn=substr_replace($sfn,'',$pos); $pos=strrpos($sfn,'/'); $sfn=substr_replace($sfn,'',$pos); print "$sfn<br>";
phpinfo(); if (file_exists("$sfn/nedi.conf")) { $conf = file("$sfn/nedi.conf"); }elseif (file_exists('/etc/nedi.conf')) { $conf = file('/etc/nedi.conf'); }else{ echo "Dude, where's nedi.conf?"; die; }
|
Some greps for nedi.conf showing differences in perl and php ...
| CODE |
odp@da1945:/srv/www/htdocs/odp/html/inc> grep "nedi.conf" * Devsend.pl: if (-e "../nedi.conf" ){ Devsend.pl: open (CONF, "../nedi.conf" ); Devsend.pl: }elsif (-e "/etc/nedi.conf"){ Devsend.pl: open (CONF, "/etc/nedi.conf" ); Devsend.pl: die "Dude, where's nedi.conf?\n"; libmisc.php: if (file_exists('/etc/nedi.conf')) { libmisc.php: $conf = file('/etc/nedi.conf'); libmisc.php: }elseif (file_exists('/var/nedi/nedi.conf')) { libmisc.php: $conf = file('/var/nedi/nedi.conf'); libmisc.php: echo "Dude, where's nedi.conf?";
odp@da1945:/srv/www/htdocs/odp/inc> grep "nedi.conf" * libmisc.pl: if (-e "$main::P/nedi.conf"){ libmisc.pl: open ("CONF", "$main::P/nedi.conf"); libmisc.pl: }elsif (-e "/etc/nedi.conf"){ libmisc.pl: open ("CONF", "/etc/nedi.conf"); libmisc.pl: die "Dude, where's nedi.conf?\n"; libsnmp.pl: if (defined $misc::descfilter and $de =~ /$misc::descfilter/){ # Only define device, if not filtered in nedi.conf
|
Work in progress
I'm experimenting with a "live nedi"
https://nedi.berlios.de/live/nedi.conf gives me problems as I don't "own" the site so ...
mkdir html/config
add.htaccess in config dir
| CODE |
AuthName "Secret" AuthType Basic Require valid-user |
mv nedi.conf to html/config
vi inc/libmisc.php to get nedi.conf in config
so it is not possible to
https://nedi.berlios.de/live/config/nedi.conf(change nedi.conf to grp www and no world access)
Good point, I actually overlooked that one in Devsend.pl...
I'm sticking to your suggestion of:
* /var/nedi/nedi.conf
* /etc/nedi.conf
Where as the /var/nedi bit is not hard coded in perl. It sorta finds itself automagically...
For special installs where you don't have access to absolute paths, you'll stell need to modify libmisc.php or Devsend.pl respectively.
Jep: really input for v2 :)
the berlios site is for if I have input to you: then you can see it with dummy data :)
me personally would prefer /etc/nedi.conf (I created a sym link)
I have nedi installed under /app/nedi, so /var/nedi doesn't make much sense.
Perhaps for future: Something like a make parameter that changes it in all files at installation if someone wants to put it elsewhere. Just an idea.
Greetings
Rufer