X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=.inspircd.inc;h=87a162a31b12699a51a3ee03672e678574694b7d;hb=465aa31a061cdce731cf2cf477769af3d19dc6c5;hp=ed22f731744f889003c466d1f04231a004086841;hpb=c1958b1235538eaea2d2e165253a912e0561e1dd;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/.inspircd.inc b/.inspircd.inc index ed22f7317..87a162a31 100644 --- a/.inspircd.inc +++ b/.inspircd.inc @@ -15,6 +15,7 @@ # I HATE PERL.. kthxbye # --------------------------------------------------- +my $basepath = "@BASE_DIR@"; my $confpath = "@CONFIG_DIR@/"; my $binpath = "@BINARY_DIR@"; my $libpath = "@LIBRARY_DIR@"; @@ -87,6 +88,8 @@ sub start { # Check to see its not 'running' already. if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; } # If we are still alive here.. Try starting the IRCd.. + print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable"); + system("$binpath/$executable"); return 1; } @@ -94,12 +97,14 @@ sub start { sub debug { # Check to see its not 'running' already. if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; } - + + print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable"); + # Check we have gdb checkgdb(); # If we are still alive here.. Try starting the IRCd.. - system("gdb --command=.gdbargs --args $binpath/$executable -nofork -debug -nolog"); + system("gdb --command=$basepath/.gdbargs --args $binpath/$executable -nofork -debug -nolog"); } sub screendebug @@ -107,6 +112,8 @@ sub screendebug # Check to see its not 'running' already. if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; } + print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable"); + #Check we have gdb checkgdb(); checkscreen(); @@ -114,7 +121,7 @@ sub screendebug # If we are still alive here.. Try starting the IRCd.. print "Starting InspIRCd in `screen`, type `screen -r` when the ircd crashes to view the gdb output and get a backtrace.\n"; print "Once you're inside the screen session press ^C + d to re-detach from the session\n"; - system("screen -m -d gdb --command=.gdbargs --args $binpath/$executable -nofork -debug -nolog"); + system("screen -m -d gdb --command=$basepath/.gdbargs --args $binpath/$executable -nofork -debug -nolog"); } sub valdebug @@ -122,6 +129,8 @@ sub valdebug # Check to see its not 'running' already. if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; } + print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable"); + # Check we have valgrind and gdb checkvalgrind(); checkgdb(); @@ -137,6 +146,8 @@ sub screenvaldebug # Check to see its not 'running' already. if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; } + print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable"); + #Check we have gdb checkvalgrind(); checkgdb();