X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=.inspircd.inc;h=54737fdd78c66fd66611bf6bdb8871566ee14942;hb=c44487d3b4e67fbbd5f736bc29da0eac3a83f4a3;hp=5ac7e84ecec616eb22641e3798c30fcb6858c479;hpb=94eb487064f37fa7bd5bcfd9c2faf8d275ad3725;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/.inspircd.inc b/.inspircd.inc index 5ac7e84ec..54737fdd7 100644 --- a/.inspircd.inc +++ b/.inspircd.inc @@ -15,11 +15,12 @@ # I HATE PERL.. kthxbye # --------------------------------------------------- -my $basepath = "@BASE_DIR@"; -my $confpath = "@CONFIG_DIR@/"; -my $binpath = "@BINARY_DIR@"; -my $libpath = "@LIBRARY_DIR@"; -my $executable = "@EXECUTABLE@"; +my $basepath = "@BASE_DIR@"; +my $confpath = "@CONFIG_DIR@/"; +my $binpath = "@BINARY_DIR@"; +my $libpath = "@LIBRARY_DIR@"; +my $executable = "@EXECUTABLE@"; +my $version = "@VERSION@"; my @filesparsed; # Lets see what they want to do.. Set the variable (Cause i'm a lazy coder) @@ -59,6 +60,11 @@ if ($arg eq "cron") { exit(); } +if ($arg eq "version") { + print "InspIRCd version: $version\n"; + exit(); +} + if ($arg eq "restart") { stop(); unlink($pidfile) if (-e $pidfile); @@ -77,7 +83,7 @@ if ($arg eq "Cheese-Sandwich") { # If we get here.. bad / no parameters. ### print "Invalid Argument: $arg\n"; -print "Usage: inspircd (start|stop|restart|rehash|status|cron)\n"; +print "Usage: inspircd (start|stop|restart|rehash|status|cron|version)\n"; exit(); ### @@ -88,6 +94,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; } @@ -95,7 +103,9 @@ 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(); @@ -108,6 +118,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(); @@ -123,6 +135,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(); @@ -138,6 +152,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(); @@ -226,7 +242,7 @@ sub getpidfile { } } else { # End of includes / No includes found. - return; + return $confpath . "inspircd.pid"; } } }