]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - make/template/inspircd
Merge insp20
[user/henk/code/inspircd.git] / make / template / inspircd
index d5e89040ddd6a240a0285732e23da77659023ac2..c14099323ea81487c06ab622f5a2b201f9212c3d 100644 (file)
@@ -1,16 +1,24 @@
 #!/usr/bin/env perl
-#       +------------------------------------+
-#       | Inspire Internet Relay Chat Daemon |
-#       +------------------------------------+
+
+#
+# InspIRCd -- Internet Relay Chat Daemon
+#
+#   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
 #
-#  InspIRCd: (C) 2002-2010 InspIRCd Development Team
-# See: http://wiki.inspircd.org/Credits
+# This file is part of InspIRCd.  InspIRCd is free software: you can
+# redistribute it and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation, version 2.
 #
-# This program is free but copyrighted software; see
-#          the file COPYING for details.
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
 #
-# ---------------------------------------------------
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+
+
 use strict;
 use POSIX;
 use Fcntl;
@@ -19,12 +27,13 @@ my $basepath        =       "@BASE_DIR@";
 my $confpath   =       "@CONFIG_DIR@/";
 my $binpath    =       "@BINARY_DIR@";
 my $runpath    =       "@BASE_DIR@";
+my $datadir    =       "@DATA_DIR@";
 my $valgrindlogpath    =       "$basepath/valgrindlogs";
-my $executable =       "@EXECUTABLE@";
+my $executable =       "inspircd";
 my $version    =       "@VERSION@";
 my $uid = "@UID@";
 
-if ($< == 0 || $> == 0) {
+if (!("--runasroot" ~~ @ARGV) && ($< == 0 || $> == 0)) {
        if ($uid !~ /^\d+$/) {
                # Named UID, look it up
                $uid = getpwnam $uid;
@@ -374,7 +383,7 @@ sub getpidfile
        }
 
        # End of includes / No includes found. Using default.
-       $pidfile = $runpath . "/data/inspircd.pid";
+       $pidfile = $datadir . "/inspircd.pid";
 }
 
 sub getstatus {