Skip to content

Commit be0a62f

Browse files
committed
Check if tun device is avaliable for installation
Signed-off-by: zelahi <[email protected]>
1 parent 2f4ae48 commit be0a62f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

rootless-install.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ checks() {
6161
>&2 echo "Aborting because rootful Docker is running and accessible. Set FORCE_ROOTLESS_INSTALL=1 to ignore."; exit 1
6262
fi
6363

64+
# Check if tun device is avaliable for rootless kit
65+
if [ ! -e /dev/net/tun ] && [ -z "$FORCE_ROOTLESS_INSTALL" ]; then
66+
>&2 echo "Aborting because /dev/net/tun is not avaliable. Set FORCE_ROOTLESS_INSTALL=1 to ignore."; exit 1
67+
fi
68+
6469
# Validate XDG_RUNTIME_DIR
6570
if [ ! -w "$XDG_RUNTIME_DIR" ]; then
6671
if [ -n "$SYSTEMD" ]; then
@@ -185,9 +190,9 @@ start_docker() {
185190
fi
186191

187192
mkdir -p $HOME/.config/systemd/user
188-
193+
189194
DOCKERD_FLAGS="--experimental"
190-
195+
191196
if [ -n "$SKIP_IPTABLES" ]; then
192197
DOCKERD_FLAGS="$DOCKERD_FLAGS --iptables=false"
193198
fi

0 commit comments

Comments
 (0)