MythTV  master
Functions
mythshutdown.cpp File Reference
#include <cstdlib>
#include <iostream>
#include <unistd.h>
#include <QtGlobal>
#include <QCoreApplication>
#include <QFile>
#include "libmyth/mythcontext.h"
#include "libmyth/programinfo.h"
#include "libmyth/remoteutil.h"
#include "libmythbase/compat.h"
#include "libmythbase/exitcodes.h"
#include "libmythbase/mythdate.h"
#include "libmythbase/mythdb.h"
#include "libmythbase/mythlogging.h"
#include "libmythbase/mythsystemlegacy.h"
#include "libmythbase/mythversion.h"
#include "libmythbase/signalhandling.h"
#include "libmythtv/jobqueue.h"
#include "libmythtv/tv.h"
#include "libmythtv/tvremoteutil.h"
#include "mythshutdown_commandlineparser.h"
Include dependency graph for mythshutdown.cpp:

Go to the source code of this file.

Functions

static void setGlobalSetting (const QString &key, const QString &v)
 
static QString getGlobalSetting (const QString &key, const QString &defaultval)
 
static int lockShutdown ()
 
static int unlockShutdown ()
 
static bool isRunning (const char *program)
 Returns true if a program containing the specified string is running on this machine. More...
 
static QDateTime getDailyWakeupTime (const QString &sPeriod)
 
static bool isRecording ()
 
static int getStatus (bool bWantRecStatus)
 
static int checkOKShutdown (bool bWantRecStatus)
 
static void setWakeupTime (const QDateTime &wakeupTime)
 
static int setScheduledWakeupTime ()
 
static int shutdown ()
 
static int startup ()
 
int main (int argc, char **argv)
 

Function Documentation

◆ setGlobalSetting()

static void setGlobalSetting ( const QString &  key,
const QString &  v 
)
static

Definition at line 31 of file mythshutdown.cpp.

Referenced by setWakeupTime(), and shutdown().

◆ getGlobalSetting()

static QString getGlobalSetting ( const QString &  key,
const QString &  defaultval 
)
static

Definition at line 60 of file mythshutdown.cpp.

Referenced by getDailyWakeupTime(), getStatus(), shutdown(), and startup().

◆ lockShutdown()

static int lockShutdown ( )
static

Definition at line 83 of file mythshutdown.cpp.

Referenced by main().

◆ unlockShutdown()

static int unlockShutdown ( )
static

Definition at line 137 of file mythshutdown.cpp.

Referenced by main().

◆ isRunning()

static bool isRunning ( const char *  program)
static

Returns true if a program containing the specified string is running on this machine.

Since many Linux distributions rename executables, and they also have different names by default on different operating systems, and this function is POSIX only use of this function is discouraged.

Warning: This function should never be passed a value which is not specified explicitly in the code, it does no checking for shell script injection.

Definition at line 207 of file mythshutdown.cpp.

Referenced by ThumbThread< ImageDbSg >::AbortDevice(), ImageScanThread< ImageDbSg >::ChangeState(), ThumbThread< ImageDbSg >::Enqueue(), MythFIFOWriter::FIFOInit(), getStatus(), and ThumbThread< ImageDbSg >::PauseBackground().

◆ getDailyWakeupTime()

static QDateTime getDailyWakeupTime ( const QString &  sPeriod)
static

Definition at line 213 of file mythshutdown.cpp.

Referenced by getStatus(), and shutdown().

◆ isRecording()

static bool isRecording ( )
static

Definition at line 224 of file mythshutdown.cpp.

Referenced by getStatus(), and RemoteGetRecordingStatus().

◆ getStatus()

static int getStatus ( bool  bWantRecStatus)
static

Definition at line 242 of file mythshutdown.cpp.

Referenced by checkOKShutdown(), and main().

◆ checkOKShutdown()

static int checkOKShutdown ( bool  bWantRecStatus)
static

Definition at line 378 of file mythshutdown.cpp.

Referenced by main().

◆ setWakeupTime()

static void setWakeupTime ( const QDateTime &  wakeupTime)
static

Definition at line 406 of file mythshutdown.cpp.

Referenced by main(), and setScheduledWakeupTime().

◆ setScheduledWakeupTime()

static int setScheduledWakeupTime ( )
static

Definition at line 418 of file mythshutdown.cpp.

Referenced by main().

◆ shutdown()

static int shutdown ( )
static

Definition at line 459 of file mythshutdown.cpp.

Referenced by main().

◆ startup()

static int startup ( )
static

Definition at line 776 of file mythshutdown.cpp.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 820 of file mythshutdown.cpp.