#!/bin/sh

if test -e "/etc/challengeCode.txt"
then
source /etc/challengeCode.txt
echo coucou

else

DATE="XX"
dateDay="0"

echo coucou1

fi

DATE=$(date +%d)

echo "date:" $DATE  "dateChallenge" $dateDay

if [ $DATE -ne $dateDay ];  then

rm /etc/challengeCode.txt
touch /etc/challengeCode.txt
chmod 777 /etc/challengeCode.txt
data=`</dev/urandom tr -dc 'ABCDEF0123456789' | head -c10;`
echo "export code="$data  >> /etc/challengeCode.txt
echo "export dateDay=$DATE"  >> /etc/challengeCode.txt


fi
