comparison contrib/dashboardctl @ 34:7162616389a5

Change PID and log file names
author Gernot Schulz <gernot@intevation.de>
date Mon, 19 Oct 2015 13:36:37 +0200
parents 70d50b6312e2
children 295e3253bb49
comparison
equal deleted inserted replaced
33:70d50b6312e2 34:7162616389a5
2 2
3 export DISPLAY=":0.0" 3 export DISPLAY=":0.0"
4 4
5 OLDDB=/home/pi/incoming_dbs/tech_intern.db 5 OLDDB=/home/pi/incoming_dbs/tech_intern.db
6 NEWDB=/home/pi/incoming_dbs/tech_intern.db.new 6 NEWDB=/home/pi/incoming_dbs/tech_intern.db.new
7
8 BOTTLEDASH_PID="$HOME/bottledash.pid"
9 BOTTLEDASH_LOG="$HOME/bottledash.log"
10 CHROMIUM_PID="$HOME/chromium.pid"
11 CHROMIUM_LOG="$HOME/chromium.log"
7 12
8 usage () { 13 usage () {
9 cat << EOF 14 cat << EOF
10 Usage: $0 [COMMAND] 15 Usage: $0 [COMMAND]
11 16
20 EOF 25 EOF
21 } 26 }
22 27
23 start_bottledash () { 28 start_bottledash () {
24 # taken from start-bottledash-hohup 29 # taken from start-bottledash-hohup
25 nohup python3 /home/pi/bottledash/dash.py 2>&1 > $HOME/bottledash.log & 30 nohup python3 /home/pi/bottledash/dash.py 2>&1 > $BOTTLEDASH_LOG &
26 echo $! > $HOME/pid_bottledash 31 echo $! > $BOTTLEDASH_PID
27 } 32 }
28 33
29 stop_bottledash () { 34 stop_bottledash () {
30 kill $(cat $HOME/pid_bottledash) 35 kill $(cat $BOTTLEDASH_PID)
31 } 36 }
32 37
33 start_chromium () { 38 start_chromium () {
34 # taken from show-dashboard 39 # taken from show-dashboard
35 rm -R $HOME/.cache/chromium/Default/Cache/ 40 rm -R $HOME/.cache/chromium/Default/Cache/
36 DISPLAY=:0.0 nohup chromium --new --noerrdialogs --kiosk \ 41 DISPLAY=:0.0 nohup chromium --new --noerrdialogs --kiosk \
37 http://localhost:8080 2>&1 > $HOME/show-dashboard.log & 42 http://localhost:8080 2>&1 > $CHROMIUM_LOG &
38 echo $! > $HOME/pid_chromium 43 echo $! > $CHROMIUM_PID
39 } 44 }
40 45
41 46
42 stop_chromium () { 47 stop_chromium () {
43 kill $(cat pid_chromium) 48 kill $(cat $CHROMIUM_PID)
44 } 49 }
45 50
46 xdo_reload_chromium () { 51 xdo_reload_chromium () {
47 # Start Chromium if necessary 52 # Start Chromium if necessary
48 if [ -f "$HOME/pid_bottledash" ] && [ -d /proc/$(cat "$HOME/pid_chromium") ]; then 53 if [ -f "$BOTTLEDASH_PID" ] && [ -d /proc/$(cat "$CHROMIUM_PID") ]; then
49 # Send F5 to Chromium 54 # Send F5 to Chromium
50 WID=$(xdotool search --onlyvisible --class chromium | head -1) 55 WID=$(xdotool search --onlyvisible --class chromium | head -1)
51 xdotool windowactivate ${WID} 56 xdotool windowactivate ${WID}
52 xdotool key F5 57 xdotool key F5
53 else 58 else
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)