diff --git a/entrypoint.sh b/entrypoint.sh index bda66bb..9c3cbce 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,8 +5,15 @@ set -e # check if /dev/net/tun is available if [ ! -e /dev/net/tun ]; then - echo "CRITIC: /dev/net/tun not pass, check https://github.com/cmj2002/warp-docker/blob/main/docs/tun-not-permitted.md for more information" - exit 1 + if [ -n "$LEGACY_TUN_SUPPORT" ]; then + echo "WARN: LEGACY_TUN_SUPPORT enabled, creating /dev/net/tun..." + sudo mkdir -p /dev/net + sudo mknod /dev/net/tun c 10 200 + sudo chmod 600 /dev/net/tun + else + echo "CRITIC: /dev/net/tun not pass, check https://github.com/cmj2002/warp-docker/blob/main/docs/tun-not-permitted.md for more information" + exit 1 + fi fi # start dbus