X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=.inspircd.inc;h=91a06ccfd6430f849f13abb93f05fcd5eb749851;hb=c4d6ce8c5e1802e5b834d5845e31c3adf7700585;hp=f419d4b8a60ec87ab59a141cbd4b44d0e3d304b3;hpb=4e5fe6922e81c04ebb3498d8110eed3048741789;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/.inspircd.inc b/.inspircd.inc index f419d4b8a..91a06ccfd 100644 --- a/.inspircd.inc +++ b/.inspircd.inc @@ -18,7 +18,6 @@ use Fcntl; my $basepath = "@BASE_DIR@"; my $confpath = "@CONFIG_DIR@/"; my $binpath = "@BINARY_DIR@"; -my $libpath = "@LIBRARY_DIR@"; my $valgrindlogpath = "$basepath/valgrindlogs"; my $executable = "@EXECUTABLE@"; my $version = "@VERSION@"; @@ -26,7 +25,7 @@ my $version = "@VERSION@"; our($pid,$pidfile); # Lets see what they want to do.. Set the variable (Cause i'm a lazy coder) my $arg = shift(@ARGV); -my $conf = $confpath . "inspircd.conf"; +my $conf; for my $a (@ARGV) { if ($a =~ m/^--config=(.*)$/) @@ -35,6 +34,11 @@ for my $a (@ARGV) last; } } +if (!defined $conf) { + $conf = $confpath . "inspircd.conf"; + push @ARGV, '--config='.$conf; +} + getpidfile($conf); # System for naming script command subs: @@ -316,10 +320,23 @@ sub getpidfile { # Set the PID file and return. $pidfile = $1; + if (-f $pidfile) + { + return; + } + else + { + if (-f $confpath . $pidfile) + { + $pidfile = $confpath . $pidfile; + return; + } + } return; } } + # If we get here, NO PID FILE! -- Check for includes for my $i (@lines) { $i =~ s/[^=]+=\s(.*)/\1/; @@ -328,6 +345,18 @@ sub getpidfile # Decend into that file, and check for PIDs.. (that sounds like an STD ;/) getpidfile($1); # Was a PID found? + if (-f $pidfile) + { + return; + } + else + { + if (-f $confpath . $pidfile) + { + $pidfile = $confpath . $pidfile; + return; + } + } if ($pidfile ne "") { # Yes, Return. return;