1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/spip_ynh.git synced 2024-09-03 20:25:59 +02:00

cat random est une mauvaise idée

This commit is contained in:
magikcypress 2017-02-22 16:05:03 +01:00
parent d58c624f4c
commit 42a4d40bd4

View file

@ -83,12 +83,12 @@ sudo sed -i "s@__DB_SHA__@$db_sha@g" ../conf/sql/spip.sql
for i in 1 2 3 4 5 6 7 8
do
j=$(cat /dev/urandom | tr -dc '0-9' | fold -w 32 | head -n 1)
j=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{40\}\).*/\1/p')
if [ "$j" = "" ];
then
# For obscure reasons, the loop is too fast at execution
sleep 1
j=$(cat /dev/urandom | tr -dc '0-9' | fold -w 32 | head -n 1)
j=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{40\}\).*/\1/p')
fi
sudo sed -i "s/__ALEA_ACTUEL__/$j/g" ../conf/sql/spip.sql
sudo sed -i "s/__ALEA_FUTUR__/$j/g" ../conf/sql/spip.sql