Bonjour all,
par un menu, j’appel les deux fonctions séparément :
[code]
map_adverts() {
clear
echo ''
while [ -z ${CONF_MAP} ]
do
read -p “Pour quel serveur voulez-vous configurer les .txt : " CONF_MAP
MANI_DIR=”$SRCDS_MULTIGAMES/$CONF_MAP/${DIRCFG}/mani_admin_plugin"; export MANI_DIR
if [ -f $MANI_DIR/adverts.txt ]; then
nano $MANI_DIR/adverts.txt
else
echo "${ROUGE}ERREUR, le fichier n’existe pas et/ou le chemin est incorrect !${NORMAL}"
exit 1
fi
done
clear
confmap
}
map_autokick_ip() {
clear
echo ''
if [ -f autokick_ip.txt ]; then
nano $MANI_DIR/autokick_ip.txt
else
echo "${ROUGE}ERREUR, le fichier n’existe pas et/ou le chemin est incorrect !${NORMAL}"
exit 1
fi
clear
confmap
}[/code]
Le premier fichier est bien ouvert mais le second me renvois l’erreur qu’il n’existe pas…
J’ai mis un echo $MANI_DIR dans la seconde fonction (avant exit 1) pour voir et elle est vide donc j’en conclus que export ne fonctionne pas comme il devrait…
Auriez-vous une suggestion ?
Cordialement