#!/bin/bash [[ ! $GITEA_DIR ]] && export GITEA_DIR="$(dirname "$(cd "$(readlink -f "$BASH_SOURCE")"; pwd -P)")" SDDIR="/etc/systemd/system" ServiceFile=$GITEA_DIR/scripts/systemd/gitea@.service echo "Installing Template Service file at $ServiceFile" echo ---- Service file as written to $SDDIR ---- cat $ServiceFile | sed 's:@d:'$GITEA_DIR':'g | sudo tee $SDDIR/gitea@.service