From 79156e0ee134342c790665ec68237173a08cd432 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 13 Sep 2020 12:50:15 +0300 Subject: [PATCH] Add test systemd unit generation script --- lp/make-units.sh | 134 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 lp/make-units.sh diff --git a/lp/make-units.sh b/lp/make-units.sh new file mode 100644 index 00000000..9ef3bad7 --- /dev/null +++ b/lp/make-units.sh @@ -0,0 +1,134 @@ +#!/bin/bash +# Example startup script generator +# Of course this isn't a production solution yet, this is just for tests + +IP=`ip -json a s | jq -r '.[].addr_info[] | select(.broadcast == "10.115.0.255") | .local'` + +[ "$IP" != "" ] || exit 1 + +useradd vitastor +chmod 755 /root + +BASE=${IP/*./} +BASE=$(((BASE-10)*12)) + +cat >/etc/systemd/system/vitastor.target </etc/systemd/system/vitastor-osd$((BASE+i)).service </etc/systemd/system/vitastor-osd$((BASE+i)).service <