#/bin/bash

### 
# Script de vérification du patch pour le i-Parapheur signature SHA256

if [ -n "$1" ]
then
  PARAPH_PATH=$1
else
  PARAPH_PATH="/opt/iParapheur"
fi

DATA_PATH="$PARAPH_PATH/alf_data/contentstore"
OLD_UID="urn:oid:1.2.250.1.131.1.5.18.21.1.4"

echo "Vérification patch en cours ..."

## TODELETE
FILES=`stdbuf -oL grep -r1 "<pPolicyIdentifierID>$OLD_UID</pPolicyIdentifierID>" $DATA_PATH | head -n1`

if [ -z "$FILES" ]
then
  echo "Patch OK"
  exit 0
else
  echo "Patch KO"
  exit 1
fi
