mirror of
https://github.com/znc/znc.git
synced 2026-05-06 21:42:28 +02:00
Add 'Uptime' command to *znc
ToDo: Use some readable format for displaying the uptime. Seconds just don't make it. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1095 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
10
Client.cpp
10
Client.cpp
@@ -1554,6 +1554,11 @@ void CClient::UserCommand(const CString& sLine) {
|
||||
PutStatus(sTmp);
|
||||
}
|
||||
}
|
||||
} 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");
|
||||
} else {
|
||||
PutStatus("Unknown command [" + sCommand + "] try 'Help'");
|
||||
}
|
||||
@@ -1752,6 +1757,11 @@ void CClient::HelpUser() {
|
||||
Table.SetCell("Arguments", "");
|
||||
Table.SetCell("Description", "Show basic traffic stats for all znc users");
|
||||
|
||||
Table.AddRow();
|
||||
Table.SetCell("Command", "Uptime");
|
||||
Table.SetCell("Arguments", "");
|
||||
Table.SetCell("Description", "Show how long ZNC is already running");
|
||||
|
||||
Table.AddRow();
|
||||
Table.SetCell("Command", "SetMOTD");
|
||||
Table.SetCell("Arguments", "<Message>");
|
||||
|
||||
Reference in New Issue
Block a user