diff --git a/doc/monithor-server.md b/doc/monithor-server.md index 0b16a65..0cd11a7 100644 --- a/doc/monithor-server.md +++ b/doc/monithor-server.md @@ -36,7 +36,7 @@ le service peut être démarré et arrêté via system V - Le fichier responsable de la gestion IP/PORT est : service.cfg -`LocalIp=10.10.10.4` +`RemoteIp=10.10.10.4` `LocalPort=1666` @@ -44,7 +44,7 @@ le service peut être démarré et arrêté via system V `LocalPassword='Evil@MonitoR-666'` -* LocalIp : correspond à l'adresse IP de l'interface réseau en écoute (dans le cas ou il y a plusieur interface réseaux) +* RemoteIp : correspond à l'adresse IP de l'interface réseau en écoute du client de monitoring * LocalPort : correspond au port de communication du client monithor diff --git a/monithor-client/etc/monithor-client/sonde.cfg b/monithor-client/etc/monithor-client/sonde.cfg deleted file mode 100644 index adc506f..0000000 --- a/monithor-client/etc/monithor-client/sonde.cfg +++ /dev/null @@ -1,8 +0,0 @@ -10.10.10.3:1666#file#/tmp/coucou -10.10.10.3:1666#file#/tmp/nop -10.10.10.3:1666#file# -10.10.10.3:1666#NotRealSondeName#reboot -10.10.10.4:1666#file#/tmp/coucou -10.10.10.4:1666#file#/tmp/nop -10.10.10.4:1666#file# -10.10.10.4:1666#NotRealSondeName#reboot diff --git a/monithor-server/etc/monithor-server/service.cfg b/monithor-server/etc/monithor-server/service.cfg index 05d364a..de5f354 100644 --- a/monithor-server/etc/monithor-server/service.cfg +++ b/monithor-server/etc/monithor-server/service.cfg @@ -1,4 +1,4 @@ -LocalIp=10.10.10.4 +RemoteIp=10.10.10.4 LocalPort=1666 ######## Crypted=no diff --git a/monithor-server/usr/local/bin/monithor-server b/monithor-server/usr/local/bin/monithor-server index 6c1f393..4ba6002 100755 --- a/monithor-server/usr/local/bin/monithor-server +++ b/monithor-server/usr/local/bin/monithor-server @@ -18,17 +18,17 @@ if [[ $(id -u) != "0" ]] Exit root fi -[[ -z $(ifconfig | grep inet | awk '{print $2}' | grep $LocalIp) ]] && Exit Config +[[ -z $(ifconfig | grep inet | awk '{print $2}' | grep $RemoteIp) ]] && Exit Config -[[ "${Crypted}" == "yes" ]] && NcCmd="cryptcat -k ${LocalPassword} -l ${LocalIp} -p ${LocalPort} " || NcCmd="nc -l ${LocalIp} ${LocalPort}" +[[ "${Crypted}" == "yes" ]] && NcCmd="cryptcat -k ${LocalPassword} -l ${RemoteIp} -p ${LocalPort} " || NcCmd="nc -l ${RemoteIp} -p ${LocalPort}" if [[ "${1}" == "start" ]] then while true do - #coproc cryptcat -k ${LocalPassword} -l ${LocalIp} -p ${LocalPort} + #coproc cryptcat -k ${LocalPassword} -l ${RemoteIp} -p ${LocalPort} coproc eval ${NcCmd} while read -r cmd; do logger "Running $cmd"