From 722c0601c1babc0a62db128c120471e6ca79af2e Mon Sep 17 00:00:00 2001 From: Gyorgy Berenyi Date: Thu, 13 Jul 2023 09:09:32 +0000 Subject: [PATCH] Update 'install.sh' Changed checking conditions order --- install.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index 87ba1d0..3582e5f 100755 --- a/install.sh +++ b/install.sh @@ -110,17 +110,6 @@ check_dirs_and_files() { chmod 0600 $HOME/.ssh/installer.pub; fi; - if [ ! -f /etc/wsl.conf ]; then - $SUDO_CMD touch /etc/wsl.conf; - fi - - SYSTEM_SETTINGS=$($SUDO_CMD grep -Pzow '\[boot\]\nsystemd\=true' /etc/wsl.conf); - if [ "$SYSTEM_SETTINGS" == "" ]; then - $SUDO_CMD echo "[boot] -systemd=true" >> /etc/wsl.conf; - echo "Not corresponding wsl configuration found, modified and need a WSL system restart from Windows terminal"; - fi - if [ ! -d "/etc/user/config" ]; then $SUDO_CMD mkdir -p "/etc/user/config" fi; @@ -463,6 +452,17 @@ if [ "$1" == "remove" ]; then exit; fi; # else run install +if [ ! -f /etc/wsl.conf ]; then + $SUDO_CMD touch /etc/wsl.conf; +fi + +SYSTEM_SETTINGS=$($SUDO_CMD grep -Pzow '\[boot\]\nsystemd\=true' /etc/wsl.conf); +if [ "$SYSTEM_SETTINGS" == "" ]; then + $SUDO_CMD echo "[boot] +systemd=true" >> /etc/wsl.conf; + echo "Not corresponding wsl configuration found, modified and need a WSL system restart from Windows terminal"; +fi + echo "Would you like to install/update docker? (y/N)"; read -r ANSWER; if [ "$ANSWER" == "y" ] || [ "$ANSWER" == "Y" ]; then