Created
January 24, 2021 13:35
-
-
Save TTTPOB/5a89254b3ceb71f22fe9cce1cde1dd2d to your computer and use it in GitHub Desktop.
socat systemd unit file for wsl2 to forward a port to windows host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Socat Greeting Service | |
Documentation=man:socat(1) | |
[Service] | |
User=root | |
Group=root | |
#ExecStart=/bin/bash -c "/usr/bin/env WSL_HOST=`tail -1 /etc/resolv.conf |cut -d' ' -f2` socat tcp-l:%i,fork,reuseaddr tcp:$WSL_HOST:%i " | |
ExecStart=/bin/bash -c "socat tcp-l:%i,fork,reuseaddr tcp:`tail -1 /etc/resolv.conf |cut -d' ' -f2`:%i" | |
Restart=on-success | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I cannot figure out why the first one wont work, it basically did the same thing with the second one but with a environment variable