bridgehead/install-bridgehead.sh

35 lines
946 B
Bash
Raw Normal View History

2022-02-16 09:59:53 +01:00
#!/bin/bash
### Note: Currently not complete, needs some features before useable for production
source lib/functions.sh
exitIfNotRoot
if ! ./lib/prerequisites.sh; then
log "Prerequisites failed, exiting"
exit 1
fi
source site.conf
2022-02-16 14:05:25 +01:00
./lib/generate.sh
2022-02-16 09:59:53 +01:00
echo -e "\nInstalling systemd units ..."
cp -v \
lib/systemd/bridgehead\@.service \
lib/systemd/bridgehead-update\@.service \
lib/systemd/bridgehead-update\@.timer \
/etc/systemd/system/
systemctl daemon-reload
echo
if ! systemctl is-active --quiet bridgehead@"${project}"; then
echo "Enabling autostart of bridgehead@${project}.service"
systemctl enable bridgehead@"${project}"
echo "Enabling nightly updates for bridgehead@${project}.service ..."
systemctl enable --now bridgehead-update@"${project}".timer
fi
echo -e "\nDone - now start your bridgehead by running\n\tsystemctl start bridgehead@${project}.service\nor by rebooting your machine."