From 8f8968a5d7c8b8bbe590395430206e0078a00201 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sat, 23 Dec 2023 22:30:13 +0100 Subject: [PATCH] fix: Ignore mknod errors --- src/network.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/network.sh b/src/network.sh index 7a9b9ee9..b9405133 100644 --- a/src/network.sh +++ b/src/network.sh @@ -191,16 +191,20 @@ closeNetwork () { # Create the necessary file structure for /dev/net/tun if [ ! -c /dev/net/tun ]; then [ ! -d /dev/net ] && mkdir -m 755 /dev/net - mknod /dev/net/tun c 10 200 - chmod 666 /dev/net/tun + if mknod /dev/net/tun c 10 200; then + chmod 666 /dev/net/tun + fi fi -[ ! -c /dev/net/tun ] && error "TUN network interface not available..." && exit 25 +if [ ! -c /dev/net/tun ]; then + error "Please add the following docker setting to your container: --device=/dev/net/tun" && exit 25 +fi # Create the necessary file structure for /dev/vhost-net if [ ! -c /dev/vhost-net ]; then - mknod /dev/vhost-net c 10 238 - chmod 660 /dev/vhost-net + if mknod /dev/vhost-net c 10 238; then + chmod 660 /dev/vhost-net + fi fi update-alternatives --set iptables /usr/sbin/iptables-legacy > /dev/null