simplier grep
This commit is contained in:
@@ -458,10 +458,10 @@ if [ -n "$WSL_DISTRO_NAME" ]; then
|
|||||||
$SUDO_CMD touch /etc/wsl.conf;
|
$SUDO_CMD touch /etc/wsl.conf;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SYSTEM_SETTINGS="$(grep -Pzow '\[boot\]\nsystemd\=true' /etc/wsl.conf > /dev/null)";
|
#SYSTEM_SETTINGS="$(grep -Pzow '\[boot\]\nsystemd\=true' /etc/wsl.conf 2> /dev/null)";
|
||||||
|
SYSTEM_SETTINGS=$(grep -w "systemd=true" /etc/wsl.conf);
|
||||||
if [ "$SYSTEM_SETTINGS" == "" ]; then
|
if [ "$SYSTEM_SETTINGS" == "" ]; then
|
||||||
echo "[boot]
|
echo -e "[boot]\nsystemd=true" | $SUDO_CMD tee -a /etc/wsl.conf;
|
||||||
systemd=true" | $SUDO_CMD tee /etc/wsl.conf;
|
|
||||||
echo "Not a corresponding wsl configuration has found, conf was modified and need a WSL system restart from Windows terminal";
|
echo "Not a corresponding wsl configuration has found, conf was modified and need a WSL system restart from Windows terminal";
|
||||||
|
|
||||||
echo "Do you want to restart the $WSL_DISTRO_NAME system now? (Y/n)";
|
echo "Do you want to restart the $WSL_DISTRO_NAME system now? (Y/n)";
|
||||||
|
Reference in New Issue
Block a user