summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-02 16:47:25 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-02 16:47:25 +0000
commitf2256deeefe9a9f57f6f6b902604c01138ad16cc (patch)
tree2180cffd6bec0487e3d8b5a7d5894b258782e39c /src/configreader.cpp
parentf288993a85681c09e3d92d8c3ab9742826923e99 (diff)
Executable include for MOTD and more
This introduces an <execfiles> tag that reads files from the output of a command, in the same way as executable includes. The files specified here can also be used anywhere a file is used (opermotd, randquote, etc) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12354 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index b34c3ecca..9db1f2665 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -588,8 +588,6 @@ void ServerConfig::Read()
}
if (valid)
{
- ReadFile(MOTD, ConfValue("files")->getString("motd"));
- ReadFile(RULES, ConfValue("files")->getString("rules"));
DNSServer = ConfValue("dns")->getString("server");
FindDNS(DNSServer);
}
@@ -792,34 +790,6 @@ ConfigTagList ServerConfig::ConfTags(const std::string& tag)
return config_data.equal_range(tag);
}
-/** Read the contents of a file located by `fname' into a file_cache pointed at by `F'.
- */
-bool ServerConfig::ReadFile(file_cache &F, const std::string& fname)
-{
- if (fname.empty())
- return false;
-
- char linebuf[MAXBUF];
-
- F.clear();
-
- FileWrapper file(fopen(fname.c_str(), "r"));
-
- if (!file)
- return false;
- while (!feof(file))
- {
- if (fgets(linebuf, sizeof(linebuf), file))
- linebuf[strlen(linebuf)-1] = 0;
- else
- *linebuf = 0;
-
- F.push_back(*linebuf ? linebuf : " ");
- }
-
- return true;
-}
-
bool ServerConfig::FileExists(const char* file)
{
struct stat sb;