mirror of
https://github.com/samply/bridgehead.git
synced 2025-12-15 04:57:32 +01:00
Result from Meeting with Patrick
This commit is contained in:
34
lib/setup-bridgehead-units.sh
Executable file
34
lib/setup-bridgehead-units.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/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
|
||||
|
||||
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."
|
||||
|
||||
# TODO: Configuration of the different modules
|
||||
Reference in New Issue
Block a user