Skip to content

Commit

Permalink
refactor: added for loop for string replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryIvo committed Oct 30, 2023
1 parent 914b98d commit 18ac126
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@ if [ ${BOARD} = "generic-device" ]; then

if [ "$RAM_MB" -gt 1024 ]; then
echo "Setting kura ram -Xms and -Xmx to ${RAM_MB_FOR_KURA}m"
sed -i "s/-Xms[0-9]*m -Xmx[0-9]*m/$RAM_REPLACEMENT_STRING/g" /opt/eclipse/kura/bin/start_kura.sh
sed -i "s/-Xms[0-9]*m -Xmx[0-9]*m/$RAM_REPLACEMENT_STRING/g" /opt/eclipse/kura/bin/start_kura_debug.sh
sed -i "s/-Xms[0-9]*m -Xmx[0-9]*m/$RAM_REPLACEMENT_STRING/g" /opt/eclipse/kura/bin/start_kura_background.sh
start_scripts_to_change=("start_kura.sh" "start_kura_debug.sh" "start_kura_background.sh")

for installer_name in "${start_scripts_to_change[@]}"; do
echo "Updating RAM values for $installer_name"
sed -i "s/-Xms[0-9]*m -Xmx[0-9]*m/$RAM_REPLACEMENT_STRING/g" "/opt/eclipse/kura/bin/$installer_name"
done
else
echo "Leaving kura ram as the default set in installer profile"
fi
Expand Down

0 comments on commit 18ac126

Please sign in to comment.