diff --git a/daq.sh b/daq.sh
index ba7b77511de08e000f132555f5616c592a40c56b..7b265e1546ba6a9888d986e112c55b43be2351af 100755
--- a/daq.sh
+++ b/daq.sh
@@ -7,20 +7,19 @@
 # Author: Carmelo Pellegrino <carmelo.pellegrino@bo.infn.it>
 #
 
-if [ $# -ne 4 ]; then
-  echo ERROR:
-  echo Syntax: $0 <run_number> <run_start_time> <run_duration_in_sec>
+if [ $# -ne 5 ]; then
+  echo "ERROR:"
+  echo "Syntax: $0 <run_number> <run_start_time> <run_duration_in_sec> <ip of the DAQ server>"
   exit -1
 fi
 
 RUN_NUMBER=$1
 RUN_START_TIME=$2
 RUN_DURATION=$3
-date
-echo Starting DU1 DAQ for RUN $RUN
+DAQ_SERVER=$4
 
-SERVER=localhost # JLigier for StateMachine
-LOGGER=localhost # JLigier for logging
+SERVER=${DAQ_SERVER} # JLigier for StateMachine
+LOGGER=${DAQ_SERVER} # JLigier for logging
 DEBUG=3          # 3 is highest
 TIMEOUT_S=20     # timeout arbitrarily set at 20 seconds
 
@@ -28,11 +27,11 @@ NUMBER_OF_FRAMES=18 # 18 doms
 
 DIR=. # where to write the data
 
-DATAFILTER=localhost # hostname of oDataFilter
-DATAQUEUE=localhost  # hostname of DataQueue
+DATAFILTER=${DAQ_SERVER} # hostname of oDataFilter
+DATAQUEUE=${DAQ_SERVER}  # hostname of DataQueue
 PORT=5556            # port to which the dataqueue will send the frames
 
-DATAWRITER=localhost # hostname of the DataWriter
+DATAWRITER=${DAQ_SERVER} # hostname of the DataWriter
 
 DETECTOR=du1cppm.detx # position of the detector file