From 82621986f396950e3ff15a74c11399cf315f22a8 Mon Sep 17 00:00:00 2001 From: Tamas Gal <himself@tamasgal.com> Date: Wed, 28 Feb 2018 21:35:53 +0100 Subject: [PATCH] Add more options --- configure | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 90d16cb..b0a69da 100755 --- a/configure +++ b/configure @@ -2,9 +2,21 @@ daq_ligier_ip="192.168.0.110" daq_ligier_port=5553 +monitoring_ligier_ip="127.0.0.1" monitoring_ligier_port=5553 tmux_session_name="km3mon" + +show_km3mon_banner() +{ + echo ' _ _ __ __ ___ __ __ _____ _ _ ' + echo '( )/ )( \/ )(__ )( \/ )( _ )( \( )' + echo ' ) ( ) ( (_ \ ) ( )(_)( ) ( ' + echo '(_)\_)(_/\/\_)(___/(_/\/\_)(_____)(_)\_)' + echo +} + + for arg in "$@"; do case "$arg" in --daq-ligier-ip=*) @@ -15,6 +27,10 @@ for arg in "$@"; do daq_ligier_port=`echo $arg | sed 's/--daq-ligier-port=//'` ;; + --monitoring-ligier-ip=*) + monitoring_ligier_ip=`echo $arg | sed 's/--monitoring-ligier-ip=//'` + ;; + --monitoring-ligier-port=*) monitoring_ligier_port=`echo $arg | sed 's/--monitoring-ligier-port=//'` ;; @@ -24,24 +40,32 @@ for arg in "$@"; do ;; --help) - echo 'usage: ./configure [options]' - echo 'options:' - echo ' --daq-ligier-ip=<ip>: The IP of the DAQ Ligier [default: ${daq_ligier_ip}].' - echo ' --daq-ligier-port=<port>: The port of the DAQ Ligier [default: ${daq_ligier_port}].' - echo ' --tmux-session-name=<name>: The name of the tmux session [default: ${tmux_session_name}].' - echo 'all invalid options are silently ignored' + show_km3mon_banner + echo 'Usage: ./configure [options]' + echo + echo ' OPTION DESCRIPTION DEFAULT' + echo " --daq-ligier-ip=<ip> The DAQ Ligier ${daq_ligier_ip}" + echo " --daq-ligier-port=<port> The port of the DAQ Ligier ${daq_ligier_port}" + echo " --monitoring-ligier-ip=<ip> The monitoring Ligier ${monitoring_ligier_ip}" + echo " --monitoring-ligier-port=<port> The port of the DAQ Ligier ${monitoring_ligier_port}" + echo " --tmux-session-name=<name> TMUX session name ${tmux_session_name}" + echo + echo 'All invalid options are silently ignored.' exit 0 ;; esac done -echo 'Generating makefile...' - echo "DAQ_LIGIER_IP = ${daq_ligier_ip}" > Makefile echo "DAQ_LIGIER_PORT = ${daq_ligier_port}" >> Makefile +echo "MONITORING_LIGIER_IP = ${monitoring_ligier_ip}" >> Makefile echo "MONITORING_LIGIER_PORT = ${monitoring_ligier_port}" >> Makefile echo "SESSION_NAME = ${tmux_session_name}" >> Makefile cat Makefile.in >> Makefile -echo 'Configuration complete, type "make start" to start the monitoring session.' +show_km3mon_banner +echo "DAQ Ligier: ${daq_ligier_ip}:${daq_ligier_port}" +echo "Monitoring Ligier: ${monitoring_ligier_ip}:${monitoring_ligier_port}" +echo +echo "Configuration complete, type \"make start\" to start the monitoring in a tmux session called \"${tmux_session_name}\"." -- GitLab