From 71ef3b0a05c526a8eb0fdf643bc26bb5e9387158 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Sat, 8 Aug 2020 15:13:39 +0200 Subject: [PATCH] Use venv with scripts --- dashboard/dashboard_update.sh | 6 +++++- facebook/facebook_update.sh | 4 ++++ menu/menu_update.sh | 4 ++++ washinsa/washinsa_update.sh | 4 ++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dashboard/dashboard_update.sh b/dashboard/dashboard_update.sh index 48ab88e..9957a43 100755 --- a/dashboard/dashboard_update.sh +++ b/dashboard/dashboard_update.sh @@ -1,5 +1,7 @@ #!/bin/bash +source venv/bin/activate + # Update washing machines cd "$HOME"/public_html/v2/washinsa && ./washinsa_update.sh @@ -8,4 +10,6 @@ cd "$HOME"/public_html/v2/dashboard || exit # Update the dashboard with the new machine list touch lock python3 dashboard_handler.py > log 2> err -rm lock \ No newline at end of file +rm lock + +deactivate \ No newline at end of file diff --git a/facebook/facebook_update.sh b/facebook/facebook_update.sh index 2f0a009..368969f 100755 --- a/facebook/facebook_update.sh +++ b/facebook/facebook_update.sh @@ -1,5 +1,9 @@ #!/bin/bash +source venv/bin/activate + touch lock python3 facebook_handler.py > log 2> err rm lock + +deactivate diff --git a/menu/menu_update.sh b/menu/menu_update.sh index ce7f915..3440c98 100755 --- a/menu/menu_update.sh +++ b/menu/menu_update.sh @@ -1,5 +1,9 @@ #!/bin/bash +source venv/bin/activate + touch lock curl "https://webservices-v2.crous-mobile.fr/ws/v1/regions/5/restaurants/114/menus" > menu_data.json && python3 menu_handler.py > log 2> err rm lock + +deactivate diff --git a/washinsa/washinsa_update.sh b/washinsa/washinsa_update.sh index 2f213f2..1475e58 100755 --- a/washinsa/washinsa_update.sh +++ b/washinsa/washinsa_update.sh @@ -1,5 +1,9 @@ #!/bin/bash +source venv/bin/activate + touch lock python3 washinsa_handler.py > log 2> err rm lock + +deactivate