#!/bin/bash # Example startup script generator # Of course this isn't a production solution yet, this is just for tests # Copyright (c) Vitaliy Filippov, 2019+ # License: MIT 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 <