#!/bin/bash ServiceName=gitea Instance=$1 [[ ! $1 ]] && echo warning no instance supplied using default && Instance=default Service=$ServiceName@$Instance systemctl is-active --quiet $Service && \ sudo systemctl enable $Service || \ echo "can't persist $Instance as it must be running first"