summaryrefslogtreecommitdiffstats
path: root/linhes/linhes-system/be_check.py
blob: b5f7a64bf981ab3076e5ba7d82f5f91d9ca6f46a (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
31
32
33
34
35
#!/usr/bin/python
#simple program to check if mythbackend is up and running
#exit code of 0 is success, anything else means it can't connect
import sys
class Logger(object):
    def __init__(self, filename="/tmp/Default.log"):
        #self.terminal = sys.stdout
        try:
            self.log = open(filename, "a")
        except:
            pass

    def write(self, message):
        try:
            #self.terminal.write(message)
            self.log.write(message)
        except:
            pass

sys.stdout = Logger("/tmp/be_check.log")


from MythTV import MythBE,MythDB
#import datetime,time,sys,subprocess





try:
    be=MythBE()
    db = MythDB()
except:
    sys.exit(1)
sys.exit(0)