mirror of
https://github.com/znc/znc.git
synced 2026-08-10 19:02:51 +02:00
Add and use CZNC::GetUptime() for getting the current uptime in human readable
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1098 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+1
-4
@@ -1555,10 +1555,7 @@ void CClient::UserCommand(const CString& sLine) {
|
||||
}
|
||||
}
|
||||
} else if (m_pUser->IsAdmin() && sCommand.CaseCmp("UPTIME") == 0) {
|
||||
time_t started = CZNC::Get().TimeStarted();
|
||||
time_t now = time(NULL);
|
||||
|
||||
PutStatus("Running for " + CString(now - started) + " seconds");
|
||||
PutStatus("Running for " + CZNC::Get().GetUptime());
|
||||
} else {
|
||||
PutStatus("Unknown command [" + sCommand + "] try 'Help'");
|
||||
}
|
||||
|
||||
@@ -94,6 +94,11 @@ CString CZNC::GetTag(bool bIncludeVersion) {
|
||||
return szBuf;
|
||||
}
|
||||
|
||||
CString CZNC::GetUptime() {
|
||||
time_t now = time(NULL);
|
||||
return CString(now - TimeStarted()) + " seconds";
|
||||
}
|
||||
|
||||
bool CZNC::OnBoot() {
|
||||
#ifdef _MODULES
|
||||
if (!GetModules().OnBoot()) {
|
||||
|
||||
@@ -110,6 +110,7 @@ public:
|
||||
bool RehashConfig(CString& sError);
|
||||
static CString GetVersion();
|
||||
static CString GetTag(bool bIncludeVersion = true);
|
||||
CString GetUptime();
|
||||
// This returns the path to the .so and to the data dir
|
||||
// which is where static data (webadmin skins) are saved
|
||||
bool FindModPath(const CString& sModule, CString& sModPath,
|
||||
|
||||
Reference in New Issue
Block a user