Skip to content

Commit

Permalink
rpm-install: galera detection with fault tolerance
Browse files Browse the repository at this point in the history
There was no need for subshell, and to make shellcheck
happy do the glob to arrays.
  • Loading branch information
grooverdan committed Nov 27, 2024
1 parent 250876c commit d32544d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/rpm-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ else
fi


sh -c 'g=/usr/lib*/galera*/libgalera_smm.so; echo -e "[galera]\nwsrep_provider=$g"' |
galera=(/usr/lib*/galera*/libgalera_smm.so)
if [ ${#galera[@]} -ne 1 ]; then
bb_log_error "Expected exactly one file, found ${#galera[@]}"
exit 1
fi
echo -e "[galera]\nwsrep_provider=${galera[0]}" |
sudo tee /etc/my.cnf.d/galera.cnf

# Any of the below steps could fail
Expand Down

0 comments on commit d32544d

Please sign in to comment.