@@ -146,18 +146,6 @@ select yn in "Yes" "No"; do
146
146
echo " del C:\Users\Public\shutdown.cmd" | sudo tee -a ~ /shutdown.cmd > /dev/null 2>&1
147
147
cp ~ /shutdown.cmd /mnt/c/Users/Public && rm ~ /shutdown.cmd
148
148
149
- if echo $( wsl.exe --version | tr -d ' \0' | sed -n 1p | cut -f3 -d " " | cut -f1 -d " ." ) > 0 || echo $( wsl.exe --version | tr -d ' \0' | sed -n 1p | cut -f3 -d " " | cut -f2 -d " ." ) > 0 || (( $(echo $(wsl.exe -- version | tr - d '\0 ' | sed - n 1 p | cut - f3 - d " " | cut - f2 - 3 - d ".") '> ' 67 .5 | bc)) ); then
150
- commandline=" systemd=true"
151
- echo " $commandline " >> /etc/wsl.conf
152
- else
153
- commandline=" command = \" /usr/bin/env -i /usr/bin/unshare --fork --mount --propagation shared --mount-proc --pid -- sh -c 'mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc; [ -x /usr/lib/systemd/systemd ] && exec /usr/lib/systemd/systemd --unit=multi-user.target || exec /lib/systemd/systemd --unit=multi-user.target'\" "
154
- echo " $commandline " >> /etc/wsl.conf
155
- wget https://raw.githubusercontent.com/diddledani/one-script-wsl2-systemd/main/src/sudoers -O /etc/sudoers.d/wsl2-systemd
156
- sed -i ' s/%sudo/%wheel/g' /etc/sudoers.d/wsl2-systemd
157
- wget https://raw.githubusercontent.com/diddledani/one-script-wsl2-systemd/4dc64fba72251f1d9804ec64718bb005e6b27b62/src/00-wsl2-systemd.sh -P /etc/profile.d/
158
- sed -i ' /\\nSystemd/d' /etc/profile.d/00-wsl2-systemd.sh
159
- fi
160
-
161
149
secs=3
162
150
printf ${ylw} " \nTo set the new user as the default user, LinuxmintWSL will shutdown and restart!!!\n\n" ${txtrst}
163
151
while [ $secs -gt 0 ]; do
@@ -177,18 +165,6 @@ select yn in "Yes" "No"; do
177
165
esac
178
166
done
179
167
180
- if echo $( wsl.exe --version | tr -d ' \0' | sed -n 1p | cut -f3 -d " " | cut -f1 -d " ." ) > 0 || echo $( wsl.exe --version | tr -d ' \0' | sed -n 1p | cut -f3 -d " " | cut -f2 -d " ." ) > 0 || (( $(echo $(wsl.exe -- version | tr - d '\0 ' | sed - n 1 p | cut - f3 - d " " | cut - f2 - 3 - d ".") '> ' 67 .5 | bc)) ); then
181
- commandline=" systemd=true"
182
- echo " $commandline " >> /etc/wsl.conf
183
- else
184
- commandline=" command = \" /usr/bin/env -i /usr/bin/unshare --fork --mount --propagation shared --mount-proc --pid -- sh -c 'mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc; [ -x /usr/lib/systemd/systemd ] && exec /usr/lib/systemd/systemd --unit=multi-user.target || exec /lib/systemd/systemd --unit=multi-user.target'\" "
185
- echo " $commandline " >> /etc/wsl.conf
186
- wget https://raw.githubusercontent.com/diddledani/one-script-wsl2-systemd/main/src/sudoers -O /etc/sudoers.d/wsl2-systemd
187
- sed -i ' s/%sudo/%wheel/g' /etc/sudoers.d/wsl2-systemd
188
- wget https://raw.githubusercontent.com/diddledani/one-script-wsl2-systemd/4dc64fba72251f1d9804ec64718bb005e6b27b62/src/00-wsl2-systemd.sh -P /etc/profile.d/
189
- sed -i ' /\\nSystemd/d' /etc/profile.d/00-wsl2-systemd.sh
190
- fi
191
-
192
168
echo " @echo off" | sudo tee -a ~ /shutdown.cmd > /dev/null 2>&1
193
169
echo " wsl.exe --terminate $WSL_DISTRO_NAME " | sudo tee -a ~ /shutdown.cmd > /dev/null 2>&1
194
170
if env | grep " WT_SESSION" > /dev/null 2>&1 ; then
@@ -200,7 +176,7 @@ echo "del C:\Users\Public\shutdown.cmd" | sudo tee -a ~/shutdown.cmd >/dev/null
200
176
cp ~ /shutdown.cmd /mnt/c/Users/Public && rm ~ /shutdown.cmd
201
177
202
178
secs=3
203
- printf ${ylw} " \nLinuxmintWSL2 will shutdown and restart to setup systemd !!!\n\n" ${txtrst}
179
+ printf ${ylw} " \nLinuxmintWSL2 will shutdown and restart to finish setup !!!\n\n" ${txtrst}
204
180
while [ $secs -gt 0 ]; do
205
181
printf " \r\033[KShutting down in %.d seconds. " $(( secs-- ))
206
182
sleep 1
0 commit comments