File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
col=30
3
3
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
4
+
4
5
# enable wireless if it is currently off
5
6
WIFI_WAS_OFF=0
6
7
if [ 0 -eq ` lipc-get-prop com.lab126.cmd wirelessEnable` ]; then
@@ -24,9 +25,17 @@ while :; do
24
25
done > /dev/null &
25
26
26
27
# waiting for powerButtonPressed
27
- lipc-set-prop -i com.lab126.powerd preventScreenSaver 1
28
+ PSS_WAS_OFF=0
29
+ if [ 0 -eq ` lipc-get-prop com.lab126.powerd preventScreenSaver` ]; then
30
+ lipc-set-prop -i com.lab126.powerd preventScreenSaver 1
31
+ PSS_WAS_OFF=1
32
+ fi
28
33
lipc-wait-event com.lab126.hal powerButtonPressed | read event # it's blocking
29
- lipc-set-prop -i com.lab126.powerd preventScreenSaver 0
34
+ # Restore PSS status
35
+ if [ 1 -eq $PSS_WAS_OFF ]; then
36
+ lipc-set-prop -i com.lab126.powerd preventScreenSaver 0
37
+ fi
38
+
30
39
kill $( jobs -p)
31
40
eips $col 3 " File Browser is turned off. "
32
41
41
50
sleep 1
42
51
eips $col 1 " "
43
52
eips $col 3 " "
53
+
54
+ # stop tasks
44
55
killall filebrowser
45
56
ps aux | grep [f]ilebrowser | awk ' {print $2}' | xargs -i kill {} > /dev/null
You can’t perform that action at this time.
0 commit comments