Modification check syncro + passage a gitea raw
Modification du check utilisant ps pour le renbdre plus standard et compatible avec les shells alternatifs (-ax est plus typé Linux) et remplacement par -e, plus répendu. Changement du check curl pour utiliser la version raw de la page au lieu de la version HTML : parsing plus fiable, plus rapide à récupérer et moins de caractères spéciaux à gérer.
This commit is contained in:
parent
6d286dce46
commit
724c0e2ae5
@ -6,7 +6,7 @@ Bitwarden_Server="<URL_DE_L_INSTANCE_BITWARDEN>"
|
||||
|
||||
# Variables internes au script
|
||||
Inception_Detect=0 # Détection de terminaux parents/enfants
|
||||
Local_Version="2.2.7"
|
||||
Local_Version="2.2.8"
|
||||
|
||||
# Fonction de suppression et nettoyage des identités
|
||||
identities_destroy() {
|
||||
@ -30,7 +30,7 @@ identities_destroy() {
|
||||
# Processus de création des identités
|
||||
if [ -z "${BW_Session}" ] || [ "${#BW_Session}" -lt 10 ]; then
|
||||
trap identities_destroy EXIT
|
||||
Latest_Version=$(curl -s "https://gitea.cloudyfy.fr/Siphonight/bw-cli_autologger/src/branch/main/bw_cli_autolog.sh" | grep -m1 "Local_Version" | cut -d ';' -f 2 | cut -d '&' -f 1)
|
||||
Latest_Version=$(curl -s "https://gitea.cloudyfy.fr/Siphonight/bw-cli_autologger/raw/branch/main/bw_cli_autolog.sh" | grep -m1 "Local_Version" | cut -d '"' -f 2)
|
||||
if [ "${Local_Version}" != "${Latest_Version}" ]; then
|
||||
tput setaf 1
|
||||
echo "Votre version de l'utilitaire n'est pas à jour."
|
||||
@ -60,7 +60,7 @@ if [ "${BW_List}" != "" ]; then
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2009
|
||||
if [ "$(ps -ax | grep 'sh -c while true; do sleep 10; bw sync -f; done' | grep -cv 'grep')" = "0" ]; then
|
||||
if [ "$(ps -e | grep 'sh -c while true; do sleep 10; bw sync -f; done' | grep -cv 'grep')" = "0" ]; then
|
||||
nohup sh -c 'while true; do sleep 10; bw sync -f; done' >/dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user