# HG changeset patch # User Gernot Schulz # Date 1445254597 -7200 # Node ID 7162616389a5cd7784190e9ac8c21f195f530449 # Parent 70d50b6312e2e3e76ec4127f48a187cebd36749a Change PID and log file names diff -r 70d50b6312e2 -r 7162616389a5 contrib/dashboardctl --- a/contrib/dashboardctl Fri Oct 16 16:16:33 2015 +0200 +++ b/contrib/dashboardctl Mon Oct 19 13:36:37 2015 +0200 @@ -5,6 +5,11 @@ OLDDB=/home/pi/incoming_dbs/tech_intern.db NEWDB=/home/pi/incoming_dbs/tech_intern.db.new +BOTTLEDASH_PID="$HOME/bottledash.pid" +BOTTLEDASH_LOG="$HOME/bottledash.log" +CHROMIUM_PID="$HOME/chromium.pid" +CHROMIUM_LOG="$HOME/chromium.log" + usage () { cat << EOF Usage: $0 [COMMAND] @@ -22,30 +27,30 @@ start_bottledash () { # taken from start-bottledash-hohup - nohup python3 /home/pi/bottledash/dash.py 2>&1 > $HOME/bottledash.log & - echo $! > $HOME/pid_bottledash + nohup python3 /home/pi/bottledash/dash.py 2>&1 > $BOTTLEDASH_LOG & + echo $! > $BOTTLEDASH_PID } stop_bottledash () { - kill $(cat $HOME/pid_bottledash) + kill $(cat $BOTTLEDASH_PID) } start_chromium () { # taken from show-dashboard rm -R $HOME/.cache/chromium/Default/Cache/ DISPLAY=:0.0 nohup chromium --new --noerrdialogs --kiosk \ - http://localhost:8080 2>&1 > $HOME/show-dashboard.log & - echo $! > $HOME/pid_chromium + http://localhost:8080 2>&1 > $CHROMIUM_LOG & + echo $! > $CHROMIUM_PID } stop_chromium () { - kill $(cat pid_chromium) + kill $(cat $CHROMIUM_PID) } xdo_reload_chromium () { # Start Chromium if necessary - if [ -f "$HOME/pid_bottledash" ] && [ -d /proc/$(cat "$HOME/pid_chromium") ]; then + if [ -f "$BOTTLEDASH_PID" ] && [ -d /proc/$(cat "$CHROMIUM_PID") ]; then # Send F5 to Chromium WID=$(xdotool search --onlyvisible --class chromium | head -1) xdotool windowactivate ${WID}