[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

petit script bash



Bonjour la liste,

J'aimerais créer un script qui test les connexion sur mon serveur avec telnet.
J'aimerais que cela soit automatiser avec un script.

Voila l'idée
Demarrer un connexion telent sur l'ip 127.0.0.1 et le ports 21
si cela repond affiche ok sinon affiche nok

Voila un debut de script

#!/bin/sh
host=127.0.0.1
port=21
cmd="nat list"
if !(telnet ${host} ${port}  > /dev/nul)
then
echo "ok"
else
echo "nok"
fi

Mais cela ne fonctionne pas

Si quelqu'un a une idée.

Merci par avance et bonne journée

Philippe



Reply to: