# I HATE PERL.. kthxbye
# ---------------------------------------------------
+my $basepath = "@BASE_DIR@";
my $confpath = "@CONFIG_DIR@/";
my $binpath = "@BINARY_DIR@";
my $libpath = "@LIBRARY_DIR@";
if ($arg eq "restart") {
stop();
+ unlink($pidfile) if (-e $pidfile);
start();
# kthxbye();
exit();
# 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;
}
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
# 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();
# 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
# 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();
# 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();
}
} else {
# End of includes / No includes found.
- return;
+ return $confpath . "inspircd.pid";
}
}
}