mirror of
https://github.com/flatcar/scripts.git
synced 2025-10-02 19:11:20 +02:00
fix(dev-db/etcd): Fix command line args for >=0.1 etcd versions.
-h is gone, replaced by -n, -c, and -s
This commit is contained in:
parent
e251ff660d
commit
5793e6c7f9
@ -16,14 +16,16 @@ BOOTSTRAP="/var/run/etcd/bootstrap.config"
|
||||
|
||||
[ ! -e $BOOTSTRAP ] && echo bootstrap config missing && exit 1
|
||||
|
||||
CLUSTER_ARGS="-n $MY_IP -c $MY_IP:4001 -s $MY_IP:7001"
|
||||
|
||||
# strip blank lines
|
||||
IPS=$(grep -v $MY_IP $BOOTSTRAP|grep -v '^\n$' |sed 's/$/:7001/'|tr '\n' ','|sed 's/^,//'|sed 's/,$//')
|
||||
|
||||
if [ -z "$IPS" ]; then
|
||||
echo "becoming master..."
|
||||
exec /usr/bin/etcd ${DEFAULT_ARGS} -h $MY_IP
|
||||
exec /usr/bin/etcd ${DEFAULT_ARGS} ${CLUSTER_ARGS}
|
||||
else
|
||||
echo "trying $IPS"
|
||||
set -x
|
||||
exec /usr/bin/etcd ${DEFAULT_ARGS} -h $MY_IP -C "$IPS"
|
||||
exec /usr/bin/etcd ${DEFAULT_ARGS} ${CLUSTER_ARGS} -C "$IPS"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user