]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - make/template/inspircd
Update documentation links.
[user/henk/code/inspircd.git] / make / template / inspircd
index ed98a186b832c872c7e1e76d69ba3e06a7fcc63a..b43ad60c9ecbb67981cf36258dc765964c36b860 100644 (file)
@@ -1,16 +1,30 @@
 #!/usr/bin/env perl
-#       +------------------------------------+
-#       | Inspire Internet Relay Chat Daemon |
-#       +------------------------------------+
+
+#
+# InspIRCd -- Internet Relay Chat Daemon
 #
-#  InspIRCd: (C) 2002-2010 InspIRCd Development Team
-# See: http://wiki.inspircd.org/Credits
+#   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
 #
-# This program is free but copyrighted software; see
-#          the file COPYING for details.
+# 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 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/>.
+#
+
+# InspIRCd          Start up the InspIRCd Internet Relay Chat Daemon
+#
+# chkconfig: 2345 55 25
+# description: InspIRCd -- Internet Relay Chat Daemon
+#
+# processname: inspircd
+
 use strict;
 use POSIX;
 use Fcntl;
@@ -19,6 +33,7 @@ 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 $version    =       "@VERSION@";
@@ -120,7 +135,7 @@ sub cmd_rehash()
 
 sub cmd_cron()
 {
-       if (getstatus() == 0) { goto &cmd_start(); }
+       if (getstatus() == 0) { goto &cmd_start(@_); }
        exit();
 }
 
@@ -134,7 +149,7 @@ sub cmd_restart(@)
 {
        cmd_stop();
        unlink($pidfile) if (-e $pidfile);
-       goto &cmd_start;
+       goto &cmd_start(@_);
 }
 
 sub hid_cheese_sandwich()
@@ -374,7 +389,7 @@ sub getpidfile
        }
 
        # End of includes / No includes found. Using default.
-       $pidfile = $runpath . "/data/inspircd.pid";
+       $pidfile = $datadir . "/inspircd.pid";
 }
 
 sub getstatus {
@@ -385,11 +400,11 @@ sub getstatus {
 
 
 sub getprocessid {
-       my $pid;
-       open PIDFILE, "< $pidfile" or return 0;
+       my $pid = 0;
+       open PIDFILE, '<', $pidfile or return 0;
        while(<PIDFILE>)
        {
-               $pid = $_;
+               /^(\d+)$/ and $pid = $1;
        }
        close PIDFILE;
        return $pid;