Skip to content

Commit

Permalink
refactor: update shard name in server.ini
Browse files Browse the repository at this point in the history
The code has been refactored to update the shard name in the server.ini file. This change ensures that the shard name in the LinuxGSM config matches the one in server.ini.
  • Loading branch information
dgibbs64 committed Sep 30, 2023
1 parent 278f47f commit 2cebdbd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lgsm/modules/fix_dst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/bin/lib32/libcurl-gnut
fi

# Keeps shard name in server.ini the same as in the LinuxGSM config.
if [ -f "${serverfiles}/server.ini" ]; then
if [ "$(grep -Ec '^name[[:space:]]*=' "${serverfiles}/server.ini")" -eq 1 ]; then
if [ "$(grep -E '^name[[:space:]]*=' "${serverfiles}/server.ini" | cut -d '=' -f2 | tr -d '"' | tr -d ' ')" != "${shard}" ]; then
if [ -f "${servercfgfullpath}" ]; then
if [ "$(grep -Ec '^name[[:space:]]*=' "${servercfgfullpath}")" -eq 1 ]; then
if [ "$(grep -E '^name[[:space:]]*=' "${servercfgfullpath}" | cut -d '=' -f2 | tr -d '"' | tr -d ' ')" != "${shard}" ]; then
fixname="update server.ini shard name"
fn_fix_msg_start
sed -i -e "s/name[[:space:]]*=.*/name = \"${shard}\"/g" "${serverfiles}/server.ini"
sed -i -e "s/name[[:space:]]*=.*/name = \"${shard}\"/g" "${servercfgfullpath}"
fn_fix_msg_end
fi
fi
Expand Down

0 comments on commit 2cebdbd

Please sign in to comment.