LukeSmithxyz / landchad

Landchad.net Website Tutorial Page
The Unlicense
373 stars 87 forks source link

ERROR -- wstunnel.sh: line 119: dig: command not found #288

Closed pahlse closed 2 months ago

pahlse commented 1 year ago

Following the wireguard install (with WebSocket Tunnel) I get the following error:

# wg-quick up mywgvpn
[#] source /etc/wireguard/wstunnel.sh && pre_up mywgvpn
/etc/wireguard/wstunnel.sh: line 119: dig: command not found
[#] ip link delete dev mywgvpn
Cannot find device "mywgvpn"

Any ideas what could be causing this?

tfasano1 commented 1 year ago

Yes, that script erroneously exits if it's given an ip address. Remember dig handles domain names and you're giving it an ip. It can't find the device because the ip address is not being set.

How to fix: edit the following lines in wstunnel.sh

if [[ -z "${remote_ip}" ]]; then echo "[#] Can't resolve ${remote}" exit 1 fi

change to

if [[ -z "${remote_ip}" ]]; then remote_ip=${remote} fi

Could you or someone else add this modification to the script and just copy and paste it into the guide or have it hosted on the repo? (feel free to add yourself to credits)