forked from willdurand/pihole-oled
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdual-test.py
98 lines (84 loc) · 2.43 KB
/
dual-test.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/python3
import os, sys
import time
import threading
from multiprocessing import Process
from modules.display import*
from modules.HostChecker import*
from modules.StatusLED import*
SystemIP = '192.168.178.27'
#192.168.178.27 is a sample, use any adress you wish.
FritzPW = 'password'
#Password of your Fritzbox
SysStart()
time.sleep(5.0)
UPTag = ''
dispcounter = 1
FirstStart = 1
Processor = threading.Thread(target=ProcessorLED, daemon=True)
BGCheck1 = threading.Thread(target=CheckIfUp, args=(SystemIP,), daemon=True)
BGCheck2 = threading.Thread(target=PiHoleUp, daemon=True)
BGCheck3 = threading.Thread(target=FBconnected, daemon=True)
Processor.start()
BGCheck1.start()
BGCheck2.start()
BGCheck3.start()
disp.clear()
disp2.clear()
while True:
if UPTag != "1":
print('If Uptag!=1')
p10 = Process(target = LeftGif)
p11 = Process(target = RightGif)
p10.start()
p11.start()
time.sleep(30.0)
f = open('/home/pi/PiHole-UI/modules/UPTag.txt', 'r')
UPTag = f.read()
p10.terminate()
p11.terminate()
if FirstStart != 1:
FirstStart = 1
if FirstStart == 1 and UPTag == '1':
print('2 Schleife nach start:', dispcounter, UPTag)
p5 = Process(target = LeftLogo)
p6 = Process(target = RightLogo)
p5.start()
p6.start()
time.sleep(5.0)
p5.terminate()
p6.terminate()
dispcounter += 1
FirstStart -= 1
if dispcounter == 2 and UPTag == '1':
print('3 Schleife nach start:', dispcounter, UPTag)
p1 = Process(target = LS1)
p2 = Process(target = RS1)
p1.start()
p2.start()
time.sleep(8.0)
p1.terminate()
p2.terminate()
dispcounter += 1
if dispcounter == 3 and UPTag == '1':
print('5 Schleife nach start:', dispcounter, UPTag)
p3 = Process(target = LS2)
p4 = Process(target = RS2)
p3.start()
p4.start()
time.sleep(8.0)
p3.terminate()
p4.terminate()
dispcounter += 1
if dispcounter == 4 and UPTag == '1':
print('6 Schleife nach start:', dispcounter, UPTag)
p8 = Process(target = ClockDisplayL)
p9 = Process(target = ClockDisplayR)
p8.start()
p9.start()
time.sleep(5.0)
p8.terminate()
p9.terminate()
dispcounter -= 2
f = open('/home/pi/PiHole-UI/modules/UPTag.txt', 'r')
UPTag = f.read()