# Copyright (C) 2015 Steven Van Acker <steven@singularity.be>
# Copyright (C) 2015 Attila Molnar <attilamolnar@hush.com>
# Copyright (C) 2014 Dan Parsons <dparsons@nyip.net>
-# Copyright (C) 2013-2014, 2016-2019 Sadie Powell <sadie@witchery.services>
+# Copyright (C) 2013-2014, 2016-2021 Sadie Powell <sadie@witchery.services>
# Copyright (C) 2012 Robby <robby@chatbelgie.be>
-# Copyright (C) 2012 Adam <Adam@anope.org>
# Copyright (C) 2011 DjSlash <djslash@djslash.org>
# Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
# Copyright (C) 2008-2009 Robin Burchell <robin+git@viroteck.net>
};
my $scriptpath = "@SCRIPT_DIR@";
-my $basepath = "@BASE_DIR@";
my $confpath = "@CONFIG_DIR@";
my $binpath = "@BINARY_DIR@";
-my $runpath = "@BASE_DIR@";
my $runtimedir = "@RUNTIME_DIR@";
-my $valgrindlogpath = "$basepath/valgrindlogs";
+my $valgrindlogpath = "@LOG_DIR@/valgrind";
my $executable = "inspircd";
my $version = "@VERSION_FULL@";
my $uid = "@UID@";
my @cmds = grep /^cmd_/, @subs;
my @devs = grep /^dev_/, @subs;
local $_;
- $_ =~ s/^(cmd|dev)_// foreach (@cmds, @devs);
- $_ =~ s/_/-/g foreach (@cmds, @devs);
+ $_ =~ s/^(cmd|dev)_// for (@cmds, @devs);
+ $_ =~ s/_/-/g for (@cmds, @devs);
print STDERR "Usage: ./inspircd (" . join("|", @cmds) . ")\n";
print STDERR "Developer arguments: (" . join("|", @devs) . ")\n";
exit GENERIC_EXIT_SUCCESS;
{
# Check to see its not 'running' already.
if (getstatus() == 1) { print "InspIRCd is already running.\n"; exit GENERIC_EXIT_SUCCESS; }
+
# If we are still alive here.. Try starting the IRCd..
- chdir $runpath;
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
print "$binpath/$executable is not executable\n" and return 0 unless(-f "$binpath/$executable" && -x "$binpath/$executable");
# Check to see its not 'running' already.
if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; }
- chdir $runpath;
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
print "$binpath/$executable is not executable\n" and return 0 unless(-f "$binpath/$executable" && -x "$binpath/$executable");
# Check to see its not 'running' already.
if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; }
- chdir $runpath;
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
#Check we have gdb
# Check to see its not 'running' already.
if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; }
- chdir $runpath;
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
print "$binpath/$executable is not executable\n" and return 0 unless(-f "$binpath/$executable" && -x "$binpath/$executable");
# Check to see its not 'running' already.
if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; }
- chdir $runpath;
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
print "$binpath/$executable is not executable\n" and return 0 unless(-f "$binpath/$executable" && -x "$binpath/$executable");
# Check to see its not 'running' already.
if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; }
- chdir $runpath;
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
print "$binpath/$executable is not executable\n" and return 0 unless(-f "$binpath/$executable" && -x "$binpath/$executable");