#!/bin/bash cd $(dirname $0) SondeFile=$(pwd)/sonde.cfg source service.cfg source functions [[ "${Crypted}" == "yes" ]] && NcCmd="timeout 0.1 cryptcat -k ${LocalPassword} ${RemoteIp} ${RemotePort} " || NcCmd="timeout 0.1 nc ${RemoteIp} ${RemotePort}" while read DATA do Cmd=$(echo $DATA| cut -d"#" -f1) Arg=$(echo $DATA| cut -d"#" -f2) Res=$( echo -e "${Cmd}#${Arg}" | eval ${NcCmd} 2> /dev/null) Ret=$? PrintRes "${Res:-5|No sonde $Cmd on serveur $RemoteIp}" PrintWeb "${Res:-5|No sonde $Cmd on serveur $RemoteIp}" $Cmd $Arg done < ${SondeFile} PrintWeb END_DNE