From 7cb561f95a3643d9cba19160725120749eeb2a16 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Tue, 20 Oct 2020 01:50:56 +0300 Subject: [PATCH] Add etcd to the example service generator --- mon/make-units.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/mon/make-units.sh b/mon/make-units.sh index cbbc0ba8..f68322ee 100644 --- a/mon/make-units.sh +++ b/mon/make-units.sh @@ -8,6 +8,43 @@ IP=`ip -json a s | jq -r '.[].addr_info[] | select(.broadcast == "10.115.0.255") [ "$IP" != "" ] || exit 1 +BASE=${IP/*./} +BASE=$((BASE-10)) + +useradd etcd + +mkdir -p /var/lib/etcd$BASE.etcd +cat >/etc/systemd/system/etcd.service <