#!/bin/bash ################################################################################ # Author: Fred (support@qo-op.com) # Version: 0.1 # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ################################################################################ now=$(date +%Y-%m-%d) echo "Ce script configure votre noeud G1sms+" IPFS=$(ps auxf --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1); 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 echo "Votre PSEUDO? (celui de votre Compte membre Duniter)" read ADMINPSEUDO if [[ "$ADMINPSEUDO" == "" ]]; then echo "IMPOSSIBLE DE CONTINUER"; exit; fi echo "Le Numéro de téléphone SMS Admin? (Support de ce noeud) (ex +33611223344)" read ADMINPHONE if [[ "$ADMINPHONE" == "" ]]; then echo "IMPOSSIBLE DE CONTINUER"; exit; fi echo "Le numéro de la carte SIM, du module SMS. AUCUNE liaison SMS? Laissez vide (défaut: +33600000000)" read MASTERPHONE if [[ "$MASTERPHONE" == "" ]]; then MASTERPHONE="+33600000000"; fi 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 cp .install/init.sh.template shell/init.sh sed -i s/pi/$YOU/g ./shell/init.sh sed -i s/+33600000000/$MASTERPHONE/g ./shell/init.sh sed -i s/au\ G1FabLab\ de\ Toulouse/$ADRESSE/g ./shell/init.sh sed -i s/+33647683646/$ADMINPHONE/g ./shell/init.sh sed -i s/Fred/$ADMINPSEUDO/g ./shell/init.sh cat ./shell/init.sh fi