wsl poweroff
This commit is contained in:
29
install.sh
29
install.sh
@@ -452,16 +452,29 @@ if [ "$1" == "remove" ]; then
|
|||||||
exit;
|
exit;
|
||||||
fi; # else run install
|
fi; # else run install
|
||||||
|
|
||||||
if [ ! -f /etc/wsl.conf ]; then
|
# running on WSL
|
||||||
$SUDO_CMD touch /etc/wsl.conf;
|
if [ -n "$WSL_DISTRO_NAME" ]; then
|
||||||
fi
|
if [ ! -f /etc/wsl.conf ]; then
|
||||||
|
$SUDO_CMD touch /etc/wsl.conf;
|
||||||
|
fi
|
||||||
|
|
||||||
SYSTEM_SETTINGS="$(grep -Pzow '\[boot\]\nsystemd\=true' /etc/wsl.conf > /dev/null)";
|
SYSTEM_SETTINGS="$(grep -Pzow '\[boot\]\nsystemd\=true' /etc/wsl.conf > /dev/null)";
|
||||||
if [ "$SYSTEM_SETTINGS" == "" ]; then
|
if [ "$SYSTEM_SETTINGS" == "" ]; then
|
||||||
echo "[boot]
|
echo "[boot]
|
||||||
systemd=true" | $SUDO_CMD tee /etc/wsl.conf;
|
systemd=true" | $SUDO_CMD tee /etc/wsl.conf;
|
||||||
echo "Not corresponding wsl configuration found, 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";
|
||||||
fi
|
|
||||||
|
echo "Do you want to restart the $WSL_DISTRO_NAME system now? (Y/n)";
|
||||||
|
read -r ANSWER;
|
||||||
|
if [ "$ANSWER" == "y" ] || [ "$ANSWER" == "Y" ] || [ "$ANSWER" == "" ] ; then
|
||||||
|
echo "Exiting. Please join again using wsl command."
|
||||||
|
$SUDO_CMD poweroff -f;
|
||||||
|
else
|
||||||
|
echo "Bye.";
|
||||||
|
exit;
|
||||||
|
fi;
|
||||||
|
fi
|
||||||
|
fi;
|
||||||
|
|
||||||
echo "Would you like to install/update docker? (y/N)";
|
echo "Would you like to install/update docker? (y/N)";
|
||||||
read -r ANSWER;
|
read -r ANSWER;
|
||||||
|
Reference in New Issue
Block a user