From 191e9863642119a5088124f714bb045de29e3348 Mon Sep 17 00:00:00 2001 From: Tobias Kussel Date: Wed, 22 Feb 2023 15:32:21 +0100 Subject: [PATCH] Add check for installation in WSL and for systemd --- lib/prepare-system.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/prepare-system.sh b/lib/prepare-system.sh index 2cba2e2..2a4fdae 100755 --- a/lib/prepare-system.sh +++ b/lib/prepare-system.sh @@ -5,6 +5,15 @@ source lib/functions.sh log "INFO" "Preparing your system for bridgehead installation ..." +# Check, if running in WSL +if [[ $(grep -i Microsoft /proc/version) ]]; then + # Check, if systemd is available + if [ ! $(systemctl) ]; then + log "ERROR" "It seems, that you have no active systemd environment in your WSL. Please follow the guide in https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/" + exit 1 + fi +fi + # Create the bridgehead user if id bridgehead &>/dev/null; then log "INFO" "Existing user with id $(id -u bridgehead) will be used by the bridgehead system units."