I do not think this script satisfies the following documented warning:
You must set
cluster.initial_master_nodes
to the same list of nodes on each node on which it is set in order to be sure that only a single cluster forms during bootstrapping and therefore to avoid the risk of data loss.
I can only recommend against doing what this script does, but at the end of the day it's your data and your decision. When it breaks you get to keep both pieces
I've added a comment linking from your script back to this thread.