blob: 204a6e9317220bd5cc5d16f889495e66a968b817 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/usr/bin/env python2
# This script will configure the myth db to allow MythWelcome to wake and shutdown the system.
from socket import gethostname
from MythTV import MythDB
mythdb = MythDB()
localhostname = gethostname()
# mythwelcome --setup
mythdb.settings[localhostname].MythShutdownNvramCmd = u'sudo sh -c \"/usr/LH/bin/mythwelcome-set-alarm.sh $time\"'
mythdb.settings[localhostname].MythShutdownWakeupTimeFmt = u'time_t'
mythdb.settings[localhostname].MythShutdownNvramRestartCmd = u''
mythdb.settings[localhostname].MythShutdownReboot = u'sudo /sbin/reboot'
mythdb.settings[localhostname].MythShutdownPowerOff = u'sudo /sbin/poweroff'
mythdb.settings[localhostname].MythShutdownXTermCmd = u'xterm'
mythdb.settings[localhostname].MythWelcomeStartFECmd = u'/usr/LH/bin/mythfrontend-start'
# mythtv-setup Shutdown/Wakeup options
if mythdb.settings[localhostname].HostSystemType == u'Master_backend':
if mythdb.settings[localhostname].HostUseMythWelcome == u'1':
if mythdb.settings.NULL.idleTimeoutSecs == u'0' or mythdb.settings.NULL.idleTimeoutSecs == None:
mythdb.settings.NULL.idleTimeoutSecs = u'60'
else:
mythdb.settings.NULL.idleTimeoutSecs = u'0'
mythdb.settings.NULL.WakeupTimeFormat = u'yyyy-MM-ddThh:mm:ss'
mythdb.settings.NULL.SetWakeuptimeCommand = u'/usr/bin/mythshutdown --setwakeup $time'
mythdb.settings.NULL.ServerHaltCommand = u'/usr/bin/mythshutdown --shutdown'
mythdb.settings.NULL.preSDWUCheckCommand = u'/usr/LH/bin/idle.py -s -d -l -r'
|