From 5d4e75aeacf08979fc80cb307efe4d78372716a3 Mon Sep 17 00:00:00 2001 From: magikcypress Date: Mon, 3 Apr 2017 13:10:45 +0200 Subject: [PATCH] [fix] Replace urandaom by helper #8 --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 030f670..ad3e6be 100644 --- a/scripts/install +++ b/scripts/install @@ -71,10 +71,10 @@ sudo sed -i "s@__DOMAIN__@$domain@g" "${final_path}/lufi.conf" sudo sed -i "s@__PATH__@$path@g" "${final_path}/lufi.conf" sudo sed -i "s@__PORT__@$port@g" "${final_path}/lufi.conf" -secret=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p') +secret=$(ynh_string_random 24) CHECK_VAR "$secret" "secret empty" sudo sed -i "s@__SECRET__@$secret@g" "${final_path}/lufi.conf" -STORE_MD5_CONFIG "lufi.conf" "${final_path}/lufi.conf" # Enregistre la somme de contrĂ´le du fichier de config +STORE_MD5_CONFIG "lufi.conf" "${final_path}/lufi.conf" # Install systemd script sudo cp ../conf/lufi.service /etc/systemd/system/lufi.service