#!/bin/sh detector_id=29 daq_ligier_ip="192.168.0.110" daq_ligier_port=5553 detector_manager_ip="192.168.0.120" monitoring_ligier_ip="127.0.0.1" monitoring_ligier_port=5553 logio_ip="127.0.0.1" logio_port=28777 webserver_port=8080 tmux_session_name="km3mon" show_km3mon_banner() { echo ' _ _ __ __ ___ __ __ _____ _ _ ' echo '( )/ )( \/ )(__ )( \/ )( _ )( \( )' echo ' ) ( ) ( (_ \ ) ( )(_)( ) ( ' echo '(_)\_)(_/\/\_)(___/(_/\/\_)(_____)(_)\_)' echo } for arg in "$@"; do case "$arg" in --detector-id=*) detector_id=`echo $arg | sed 's/--detector-id=//'` ;; --daq-ligier-ip=*) daq_ligier_ip=`echo $arg | sed 's/--daq-ligier-ip=//'` ;; --daq-ligier-port=*) daq_ligier_port=`echo $arg | sed 's/--daq-ligier-port=//'` ;; --detector-manager-ip=*) detector_manager_ip=`echo $arg | sed 's/--detector-manager-ip=//'` ;; --monitoring-ligier-port=*) monitoring_ligier_port=`echo $arg | sed 's/--monitoring-ligier-port=//'` ;; --logio-ip=*) logio_ip=`echo $arg | sed 's/--logio-ip=//'` ;; --logio-port=*) logio_port=`echo $arg | sed 's/--logio-port=//'` ;; --tmux-session-name=*) tmux_session_name=`echo $arg | sed 's/--tmux-session-name=//'` ;; --webserver-port=*) webserver_port=`echo $arg | sed 's/--webserver-port=//'` ;; --help) show_km3mon_banner echo 'Usage: ./configure [options]' echo echo ' OPTION DESCRIPTION DEFAULT' echo " --detector-id Detector ID ${detector_id}" echo " --daq-ligier-ip DAQ Ligier ${daq_ligier_ip}" echo " --daq-ligier-port Port of the DAQ Ligier ${daq_ligier_port}" echo " --detector-manager-ip Detector Manager for RTTC ${detector_manager_ip}" echo " --monitoring-ligier-port Port of the monitoring Ligier ${monitoring_ligier_port}" echo " --logio-ip Log.io IP ${logio_ip}" echo " --logio-port Port of the Log.io server ${logio_port}" echo " --tmux-session-name TMUX session name ${tmux_session_name}" echo " --webserver-port Port of the web server ${webserver_port}" echo echo 'All invalid options are silently ignored.' exit 0 ;; esac done echo "DETECTOR_ID = ${detector_id}" > Makefile echo "DAQ_LIGIER_IP = ${daq_ligier_ip}" >> Makefile echo "DAQ_LIGIER_PORT = ${daq_ligier_port}" >> Makefile echo "DETECTOR_MANAGER_IP = ${detector_manager_ip}" >> Makefile echo "MONITORING_LIGIER_PORT = ${monitoring_ligier_port}" >> Makefile echo "LOGIO_IP = ${logio_ip}" >> Makefile echo "LOGIO_PORT = ${logio_port}" >> Makefile echo "WEBSERVER_PORT = ${webserver_port}" >> Makefile echo "SESSION_NAME = ${tmux_session_name}" >> Makefile cat Makefile.in >> Makefile show_km3mon_banner echo "Detector ID: ${detector_id}" echo "DAQ Ligier: ${daq_ligier_ip}:${daq_ligier_port}" echo "Detector Manager: ${detector_manager_ip}" echo "Monitoring Ligier: ${monitoring_ligier_ip}:${monitoring_ligier_port}" echo "Log.io Server: ${logio_ip}:${logio_port}" echo "Webserver: 0.0.0.0:${webserver_port}" echo "TMUX session: ${tmux_session_name}" echo echo "Configuration complete, type \"make start\" to start the monitoring in a tmux session called \"${tmux_session_name}\"."