X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fresources%2Fft-client%2Fpre-start.sh;fp=example%2Fdiameter%2Flauncher%2Fresources%2Fft-client%2Fpre-start.sh;h=b1863afdc2feb9a3a7bb8a99bbeae217b9b8046d;hb=2ddc4abd3627f5f5b4df32de199f364aa3844491;hp=0000000000000000000000000000000000000000;hpb=b5a7dd9cd05eb652f63e10a77dc26af49b9a6ff2;p=anna.git diff --git a/example/diameter/launcher/resources/ft-client/pre-start.sh b/example/diameter/launcher/resources/ft-client/pre-start.sh new file mode 100755 index 0000000..b1863af --- /dev/null +++ b/example/diameter/launcher/resources/ft-client/pre-start.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# Remove logs: +rm *.log* *.csv 2>/dev/null + +# Client sockets: +entity_dflt=`cat .entity 2>/dev/null` +entityServerSessions_dflt=`cat .entityServerSessions 2>/dev/null` + +# Stack: +dictionary_dflt=`cat .dictionary 2>/dev/null` + +echo +echo +# If all have values: +if [ "$entity_dflt" != "" -a "$entityServerSessions_dflt" != "" -a "$dictionary_dflt" != "" ] +then + echo "Do you wish to answer wizard commandline configuration ? (y/n) [n]:" + read wizard + [ "$wizard" = "" ] && wizard=n + [ "$wizard" = "n" ] && exit +fi + +# DEFAULTS +#[ "$entity_dflt" = "" ] && entity_dflt="192.168.12.11:3868,192.168.12.21:3868" +[ "$entity_dflt" = "" ] && entity_dflt="localhost:3868" +[ "$entityServerSessions_dflt" = "" ] && entityServerSessions_dflt=10 +[ "$dictionary_dflt" = "" ] && dictionary_dflt=dictionary.xml + + +# Wizard +echo "Diameter dictionary: you could use '/opt/bin/anna/example_diameter_stackManagement' tool in order to build" +echo " autonomous dictionaries for any kind of application. The key is to concatenate xml contents (ietf, 3gpp," +echo " vendor-specific, etc.). See 'example/diameter/stackManagement/self_ruling_setups.sh' for this." +echo +echo "This launcher can also join them providing a comma-separated list (dictionaries available on ./stack)." +echo "By default, a QoS Application setup is suggested. Input the desired configuration instead, or press ENTER:" +echo +echo " [$dictionary_dflt]:" +read dictionary +[ "$dictionary" = "" ] && dictionary=$dictionary_dflt + +# As client: +echo "Diameter entity server sessions (0: diameter entity disabled) [$entityServerSessions_dflt]:" +read entityServerSessions +[ "$entityServerSessions" = "" ] && entityServerSessions=$entityServerSessions_dflt + +entity= +if test "$entityServerSessions" != "0" +then + echo "Target diameter entity (pipe-separated : socket literal list) ["$entity_dflt"]:" + read entity +fi +[ "$entity" = "" ] && entity="$entity_dflt" + +# Configure: +echo $dictionary > .dictionary +echo $entity > .entity +echo $entityServerSessions > .entityServerSessions + +echo +echo +