Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Get wsl ip:
#!/bin/bash
rawIp=$(ip addr | grep eth0)
rawIp=$(echo $rawIp | egrep -o '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}\/')
echo ${rawIp::-1}
#!/bin/bash
hosts=/c/Windows/System32/drivers/etc/hosts
newHosts=/tmp/hosts
cp $hosts $newHosts
originIp=$(cat $newHosts | grep wsl)
newIp="$(getWslIp) wsl"
sed -i "s/$originIp/$newIp/" $newHosts
cp $newHosts $hosts
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0
there are already several answers about static ip address.
How now to add it to the firewall exceptions in the antivirus?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question