post_install_sid.sh: define default value and doesn't exit anymore if no

personnal "informations" file isn't available.
This commit is contained in:
gardouille 2015-11-11 23:40:33 +01:00
parent 12558b7b10
commit 13927ef818

View File

@ -168,14 +168,26 @@ OPTIONS=""
# Default grub timeout
grub_timeout='5'
# Load additionnal informations (new_username, new_user_mail, …) and override some variables
# Default user informations
new_username=$(ls -1 /home | grep -v "lost+found" | tail -n 1)
new_user_mail="${new_username}"
# Load personnal informations (new_username, new_user_mail, …) and override some variables
if [ -f ${script_path}/informations ]; then
. ${script_path}/informations
else
printf '%b' "You should define a ${script_path}/informations file\n"
printf '%b' "Or simply copy the template:\n"
printf '%b' "cp ${script_path}/Informations.template ${script_path}/informations\n"
exit 1
printf '%b' "cp ${script_path}/informations.template ${script_path}/informations\n"
printf '%b' "Otherwise the script will use defaults values such as '${new_username}' as main user.\n"
time=10
printf '%b' "The script will continue in ${time} seconds "
while [ "${time}" -gt 0 ]; do
printf '%b' "."
time=$((time-1))
sleep 1
done
clear
fi
# Fin des variables globales