X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fresources%2Fpre-start.sh;fp=example%2Fdiameter%2Flauncher%2Fresources%2Fpre-start.sh;h=24c22b9094f491f3f20bc15001b7fe5bd354ee9e;hb=a6974c96b83e3c9056574010a40a7eaa391e23d9;hp=3860b9395ab5de6a75b23c794cb48968171daaaa;hpb=21ba1356fdba7803d6c880ad8f4b44e52c0d9ddc;p=anna.git diff --git a/example/diameter/launcher/resources/pre-start.sh b/example/diameter/launcher/resources/pre-start.sh index 3860b93..24c22b9 100755 --- a/example/diameter/launcher/resources/pre-start.sh +++ b/example/diameter/launcher/resources/pre-start.sh @@ -17,54 +17,69 @@ dictionary_dflt=`cat .dictionary 2>/dev/null` echo echo -# Fast start -quick () { - echo "Do you wish to answer wizard commandline configuration ? (y/n) [n]:" - read wizard - [[ "$wizard" = "" ]] && wizard=n - [[ "$wizard" = "n" ]] && exit -} - -[ "$httpServer_dflt" != "" -a "$diameterServer_dflt" != "" -a "$diameterServerSessions_dflt" != "" -a \ +# If all have values: +if [ "$httpServer_dflt" != "" -a "$diameterServer_dflt" != "" -a "$diameterServerSessions_dflt" != "" -a \ "$entity_dflt" != "" -a "$entityServerSessions_dflt" != "" -a \ - "$dictionary_dflt" != "" ] && quick + "$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 +[[ "$httpServer_dflt" = "" ]] && httpServer_dflt="localhost:9000" +[[ "$diameterServer_dflt" = "" ]] && diameterServer_dflt="localhost:3868" +[[ "$diameterServerSessions_dflt" = "" ]] && diameterServerSessions_dflt=1 +[[ "$entity_dflt" = "" ]] && entity_dflt="localhost:4000,localhost:4001" +[[ "$entityServerSessions_dflt" = "" ]] && entityServerSessions_dflt=0 +[[ "$dictionary_dflt" = "" ]] && dictionary_dflt=dictionary.xml + # Wizard -[[ "$httpServer_dflt" = "" ]] && httpServer_dflt="localhost:9000" echo "HTTP Management interface address (using i.e. curl tool) as : socket literal [$httpServer_dflt]:" read httpServer [[ "$httpServer" = "" ]] && httpServer=$httpServer_dflt -echo "Diameter dictionary: you could use '/opt/bin/anna/example_diameter_stackManagement' tool in order to build an" -echo " autonomous dictionary for any kind of application. See 'example/diameter/stackManagement/self_ruling_setups.sh'." +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 -[[ "$dictionary_dflt" = "" ]] && dictionary_dflt=dictionary.xml -echo "Diameter stack pathfiles [$dictionary_dflt]:" +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 -[[ "$diameterServer_dflt" = "" ]] && diameterServer_dflt="localhost:3868" -echo "Diameter own server address as : socket literal [$diameterServer_dflt]:" -read diameterServer -[[ "$diameterServer" = "" ]] && diameterServer=$diameterServer_dflt - -[[ "$diameterServerSessions_dflt" = "" ]] && diameterServerSessions_dflt=0 +# As server: echo "Diameter own server available connections (0: diameter server disabled) [$diameterServerSessions_dflt]:" read diameterServerSessions [[ "$diameterServerSessions" = "" ]] && diameterServerSessions=$diameterServerSessions_dflt +diameterServer= +if test "$diameterServerSessions" != "0" +then + echo "Diameter own server address as : socket literal [$diameterServer_dflt]:" + read diameterServer +fi +[[ "$diameterServer" = "" ]] && diameterServer=$diameterServer_dflt -[[ "$entity_dflt" = "" ]] && entity_dflt="localhost:4000,localhost:4001" -echo "Target diameter entity (pipe-separated : socket literal list) ["$entity_dflt"]:" -read entity -[[ "$entity" = "" ]] && entity="$entity_dflt" - -[[ "$entityServerSessions_dflt" = "" ]] && entityServerSessions_dflt=1 +# 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 $httpServer > .httpServer echo $dictionary > .dictionary echo $diameterServer > .diameterServer