@@ -229,7 +229,7 @@ pgpwd="$(cat /dev/urandom | tr -dc '[:alpha:][:digit:]' | fold -w ${1:-11} | hea
229229pgpassword=$pgpwd " Meh1!"
230230
231231# get IP
232- NIC=$( route | grep default | awk ' {print $8}' )
232+ NIC=$( route | grep default | awk ' {print $8}' | head -n 1 )
233233IP=$( ip addr show $NIC | grep -m 1 " inet " | awk ' {print $2}' | cut -d " /" -f1)
234234
235235printf $info " \nProceeding with IP address: $IP \n"
@@ -243,14 +243,20 @@ sed -i "s/takserver.jks/$IP.jks/g" tak/CoreConfig.xml
243243# Better memory allocation:
244244# By default TAK server allocates memory based upon the *total* on a machine.
245245# In the real world, people not on a gov budget use a server for more than one thing.
246- # Instead we allocate memory based upon the available memory so this still scales, but you can run it on a smaller budget
247- sed -i " s/MemTotal/MemFree/g" tak/setenv.sh
246+ # Instead we allocate a fixed amount of memory
247+ read -p " Enter the amount of memory to allocate, in kB. Default [8000000]: " mem
248+ if [ -z " $mem " ];
249+ then
250+ mem=" 8000000"
251+ fi
252+
253+ sed -i " s%\` awk '/MemTotal/ {print \$ 2}' /proc/meminfo\` %$mem %g" tak/setenv.sh
248254
249255# # Set variables for generating CA and client certs
250256printf $warning " SSL setup. Hit enter (x3) to accept the defaults:\n"
251- read -p " State (for cert generation). Default [state] :" state
252- read -p " City (for cert generation). Default [city]:" city
253- read -p " Organizational Unit (for cert generation). Default [org]:" orgunit
257+ read -p " State (for cert generation). Default [state] : " state
258+ read -p " City (for cert generation). Default [city]: " city
259+ read -p " Organizational Unit (for cert generation). Default [org]: " orgunit
254260
255261if [ -z " $state " ];
256262then
@@ -326,7 +332,7 @@ cd ../../
326332
327333printf $info " Waiting for TAK server to go live. This should take <1m with an AMD64, ~2min on a ARM64 (Pi)\n"
328334$DOCKER_COMPOSE start tak
329- sleep 360
335+ sleep 10
330336
331337# ## Checks if java is fully initialised
332338while :
0 commit comments