Skip to content

Commit

Permalink
wslu: fixes SC2004
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick330602 committed Feb 21, 2020
1 parent b95023f commit 3379028
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/etc/wslusc-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ if [[ -n $WSL_INTEROP ]]; then
fi

if ( eval "$ipconfig_exec" | grep -n -m 1 "Default Gateway.*: [0-9a-z]" | cut -d : -f 1 ) >/dev/null; then
set +H
wsl2_d_tmp="$(eval "$ipconfig_exec" | grep -n -m 1 "Default Gateway.*: [0-9a-z]" | cut -d : -f 1)"
wsl2_d_tmp="$(eval "$ipconfig_exec" | sed $(( $wsl2_d_tmp - 4 ))','$(( $wsl2_d_tmp + 0 ))'!d' | grep IPv4 | cut -d : -f 2 | sed -e "s|\s||g" -e "s|\r||g")"
wsl2_d_tmp="$(eval "$ipconfig_exec" | sed $(( wsl2_d_tmp - 4 ))','$(( wsl2_d_tmp + 0 ))'!d' | grep IPv4 | cut -d : -f 2 | sed -e "s|\s||g" -e "s|\r||g")"
set -H
export DISPLAY=${wsl2_d_tmp}:0.0
else
wsl2_d_tmp="$(grep nameserver /etc/resolv.conf | awk '{print $2}')"
Expand Down
2 changes: 1 addition & 1 deletion src/wslview.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if [[ "$lname" != "" ]]; then
if [[ "$lname" =~ ^file:\/\/\/.* ]]; then
wslutmpbuild=$("$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/reg.exe query "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion" /v CurrentBuild | tail -n 2 | head -n 1 | sed -e 's|\r||g')
wslutmpbuild=${wslutmpbuild##* }
wslutmpbuild="$(( $wslutmpbuild + 0 ))"
wslutmpbuild="$(( wslutmpbuild + 0 ))"
if [ $wslutmpbuild -ge $BN_MAY_NINETEEN ]; then
# if Windows 10 is in version 1903 or later
properfile_full_path="$(readlink -f "${lname//file:\/\//}")"
Expand Down

0 comments on commit 3379028

Please sign in to comment.