From 032d2997d543ffe7734ddee9d417be232773a105 Mon Sep 17 00:00:00 2001 From: tzatzikiweeb Date: Tue, 5 May 2020 13:39:35 +0300 Subject: [PATCH] Update 'anime_scripts/jellyfin-namer-new.sh' --- anime_scripts/jellyfin-namer-new.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/anime_scripts/jellyfin-namer-new.sh b/anime_scripts/jellyfin-namer-new.sh index 1c5a098..b9bf71b 100644 --- a/anime_scripts/jellyfin-namer-new.sh +++ b/anime_scripts/jellyfin-namer-new.sh @@ -1,12 +1,21 @@ #!/bin/bash #Check if requests is installed, and if not install it -python -c "import requests" -if [[ "$?" == "1" ]]; then - apt update - apt install python-requests +if [[ -f /tmp/request_install_lock ]]; then + while [[ -f /tmp/requests_install_lock ]]; do + sleep 1 + done +else + python -c "import requests" + if [[ "$?" == "1" ]]; then + echo '' > /tmp/requests_install_lock + apt update + apt install python-requests + rm /tmp/requests_install_lock + fi fi + #Gets the last part of the current directory function get_bottom_dir() { IFS='/';