Skip to content

Commit 1af4ea5

Browse files
committed
align with KOSSH version
1 parent d6153f2 commit 1af4ea5

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

filebrowser_wrapper.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/sh
22
col=30
33
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
4+
45
# enable wireless if it is currently off
56
WIFI_WAS_OFF=0
67
if [ 0 -eq `lipc-get-prop com.lab126.cmd wirelessEnable` ]; then
@@ -24,9 +25,17 @@ while :; do
2425
done > /dev/null &
2526

2627
# 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
2833
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+
3039
kill $(jobs -p)
3140
eips $col 3 "File Browser is turned off. "
3241

@@ -41,5 +50,7 @@ fi
4150
sleep 1
4251
eips $col 1 " "
4352
eips $col 3 " "
53+
54+
# stop tasks
4455
killall filebrowser
4556
ps aux | grep [f]ilebrowser | awk '{print $2}' | xargs -i kill {} > /dev/null

0 commit comments

Comments
 (0)