echo "------------------------------------------------------------------------"
echo "Initialisation de ALLO, merci de renseigner les informations suivantes :"
echo "------------------------------------------------------------------------"
+validation=false
+while [ "$validation" = false ] ; do
read -p "FQDN (interne) de l'application [instance.mondomaine.local] : "
if [ "$REPLY" == "" ]
then
else
usager="$REPLY"
fi
-# To-do : choix entre générer ref client et utiliser une existante
-read -p "Type de la collectivité [ville/ca/cr/cc/cg/cdg/sdis/AUTRE(laisser vide)] : "
-type_com="$REPLY"
-read -p "Nom de la collectivité/du client [] : "
-nom_com="$REPLY"
-# To-do : ajout numéro de fin (code postal ?)
-reference_client_mini="${type_com:0:5}${nom_com:0:4}"
-reference_client=${reference_client_mini^^}
-
+read -p "Reférence du client [] : "
+reference_client="$REPLY"
echo "FQDN interne : "${fqdn_interne}
echo "FQDN externe : "${fqdn_externe}
echo "Canal de mise à jour : "${canal}
echo "Type d'usager : "${usager}
echo "Référence client : "${reference_client}
-# To-do : boucler tant que infos pas correctes
-
+read -p "Ces informations sont-elles correctes [O/n] ? "
+if [ "$REPLY" == "" ] || [ "$REPLY" == "o" ] || [ "$REPLY" == "O" ] || [ "$REPLY" == "oui" ] || [ "$REPLY" == "Oui" ] || [ "$REPLY" == "OUI" ]
+then
+ validation=true
+fi
+done
# TEST DE CONNEXION
fqdn_interne="api_test"
code=$(curl -s -w "%{http_code}" --max-time 5 --output /dev/null "http://${fqdn_interne}/api/rest/allo/version")
case "${produit}" in
"i-Parapheur")
prefixe="IP"
+ ;;
+ "as@lae")
+ prefixe="AS"
;;
*)
- #echo "Produit non reconnu" 2>&1 | tee -a $log_file
+ echo "Produit non reconnu" 2>&1 | tee -a $log_file
;;
esac
#fi
echo "# Fqdn interne" >> $configuration
echo 'instance_fqdn_interne="'${fqdn_interne}'"' >> $configuration
echo "# Fqdn externe" >> $configuration
-echo '#instance_fqdn.externe="'${fqdn_externe}'"' >> $configuration
+echo 'instance_fqdn_externe="'${fqdn_externe}'"' >> $configuration
echo "# ALLO Serveur" >> $configuration
echo 'allo_serveur_url="allo_serveur"' >> $configuration
echo "# Type de données acceptées" >> $configuration
echo 'request_type="Content-Type: application/json"' >> $configuration
echo "# Logs" >> $configuration
echo 'log_file="allo_agent.log"' >> $configuration
+echo 'Initialisation de ALLO réussie !'