Commit 29c533f1 authored by Dorian Zedler's avatar Dorian Zedler

some minor updates to startup scripts

parent 5c1c68a1
...@@ -55,7 +55,8 @@ cd "$parent_path" ...@@ -55,7 +55,8 @@ cd "$parent_path"
function doScStwUpdate { function doScStwUpdate {
# check if there is a new version available # check if there is a new version available
UPDATE_FILE=./bin/speed_climbing_stopwatch_basestation-update.zip UPDATE_FILENAME=ScStwBasestation-update.zip
UPDATE_FILE=./bin/"$UPDATE_FILENAME"
if [ -f "$UPDATE_FILE" ]; then if [ -f "$UPDATE_FILE" ]; then
echo "UPDATE FOUND" echo "UPDATE FOUND"
...@@ -68,7 +69,7 @@ function doScStwUpdate { ...@@ -68,7 +69,7 @@ function doScStwUpdate {
fi fi
# move the new version archive out of the bin dir # move the new version archive out of the bin dir
mv ./bin/speed_climbing_stopwatch_basestation-update.zip ./ mv "$UPDATE_FILE" ./
# backup the old version # backup the old version
mv ./bin "$OLD_VER_DIR" mv ./bin "$OLD_VER_DIR"
...@@ -77,11 +78,14 @@ function doScStwUpdate { ...@@ -77,11 +78,14 @@ function doScStwUpdate {
mkdir ./bin mkdir ./bin
# move the new version archive there and unpack it # move the new version archive there and unpack it
mv speed_climbing_stopwatch_basestation-update.zip ./bin mv ./"$UPDATE_FILENAME" ./bin
unzip ./bin/speed_climbing_stopwatch_basestation-update.zip -d ./bin unzip "$UPDATE_FILE" -d ./bin
# remove the new version archive # remove the new version archive
rm ./bin/speed_climbing_stopwatch_basestation-update.zip rm "$UPDATE_FILE"
# fix file permissions
chmod -R 777 /home/pi/ScStwBasestation
echo "UPDATE DONE" echo "UPDATE DONE"
fi fi
...@@ -89,12 +93,12 @@ function doScStwUpdate { ...@@ -89,12 +93,12 @@ function doScStwUpdate {
doScStwUpdate doScStwUpdate
sudo LD_LIBRARY_PATH=./bin/ ./bin/speed_climbing_stopwatch_basestation sudo LD_LIBRARY_PATH=./bin/lib ./bin/ScStwBasestation
``` ```
- Create the file /home/pi/StartScStw.sh with content: - Create the file /home/pi/StartScStw.sh with content:
``` ```
#!/bin/bash #!/bin/bash
sudo /home/pi/speed_climbing_stopwatch_basestation/start.sh & sudo /home/pi/ScStwBasestation/start.sh &
sudo xinit /home/pi/ScStwMonitor/start.sh & sudo xinit /home/pi/ScStwMonitor/start.sh &
``` ```
- Create the file /home/pi/ScStwMonitor/bin/start.sh with content: - Create the file /home/pi/ScStwMonitor/bin/start.sh with content:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment