-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path0002.sh
More file actions
executable file
·26 lines (21 loc) · 846 Bytes
/
0002.sh
File metadata and controls
executable file
·26 lines (21 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
ETCD_PORT=${ETCD_PORT:-4001}
ETCD="$HOST:$ETCD_PORT"
ETCDCTL="etcdctl -C $ETCD"
# April 8, 2015: If registrationEnabled key exists, migrate it to registrationMode and delete it.
if [[ "$($ETCDCTL get /deis/migrations/data/0002 2> /dev/null)" != "done" ]];
then
if $ETCDCTL ls /deis/controller | grep -q '/deis/controller/registrationEnabled'
then
if [[ "$($ETCDCTL get /deis/controller/registrationEnabled 2> /dev/null)" == "false" ]]
then
$ETCDCTL set /deis/controller/registrationMode "disabled"
else
$ETCDCTL set /deis/controller/registrationMode "enabled"
fi
$ETCDCTL rm /deis/controller/registrationEnabled
else
echo "registrationEnabled key doesn't exist, skipping migration"
fi
$ETCDCTL set /deis/migrations/data/0002 "done"
fi