From 2e79716945304140dafea1ff7099a40b1c09bddf Mon Sep 17 00:00:00 2001 From: poka Date: Fri, 6 Dec 2019 14:13:01 +0000 Subject: [PATCH] Fix template for config.sh --- config.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/config.sh b/config.sh index 3d3e7d1..9f54b97 100755 --- a/config.sh +++ b/config.sh @@ -6,10 +6,12 @@ ################################################################################ now=$(date +%Y-%m-%d) -echo "Ce script configure votre noeud G1sms+ (effacez ./shell/init.sh avant de le lancer)" +echo "Ce script configure votre noeud G1sms+" IPFS=$(ps auxf --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1); -if [[ -f ./shell/init.sh.template && ! -f ./shell/init.sh ]]; then +cp .install/init.sh.template ./shell/init.sh + +if [[ -f .install/init.sh.template ]]; then echo "Quel est l'utilisateur du système IPFS (détecté: $IPFS)?" read YOU if [[ "$YOU" == "" ]]; then YOU=$IPFS; fi @@ -29,16 +31,17 @@ if [[ -f ./shell/init.sh.template && ! -f ./shell/init.sh ]]; then echo "L'adresse où se trouve votre G1Node pour indiquer où venir chercher ses G1Tag (ex: au G1FabLab de Toulouse)" read ADRESSE + echo "LES PARAMETRES SONT BONS? Appliquer? ENTER ou CTRL-C ?" + read + + [[ -f ./shell/init.sh ]] && mv ./shell/init.sh ./shell/init.sh.old + sed -i s/pi/$YOU/g ./shell/init.sh.template sed -i s/+33600000000/$MASTERPHONE/g ./shell/init.sh.template sed -i s/au\ G1FabLab\ de\ Toulouse/$ADRESSE/g ./shell/init.sh.template sed -i s/+33647683646/$ADMINPHONE/g ./shell/init.sh.template sed -i s/Fred/$ADMINPSEUDO/g ./shell/init.sh.template - cat ./shell/init.sh.template + cat ./shell/init.sh - echo "LES PARAMETRES SONT BONS? Appliquer? ENTER ou CTRL-C ?" - read - cp ./shell/init.sh.template ./shell/init.sh fi -