diff 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
line wrap: on
line diff
--- 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}
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)