LoremPizza commited on
Commit
f91e299
·
verified ·
1 Parent(s): 66955e7

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +6 -5
entrypoint.sh CHANGED
@@ -3,12 +3,13 @@
3
  # exit when any command fails
4
  set -e
5
 
6
- # create a tun device
7
- mkdir -p /dev/net
8
- mknod /dev/net/tun c 10 200
9
- chmod 600 /dev/net/tun
 
10
 
11
- # start dbus
12
  mkdir -p /run/dbus
13
  if [ -f /run/dbus/pid ]; then
14
  rm /run/dbus/pid
 
3
  # exit when any command fails
4
  set -e
5
 
6
+ # Check if /dev/net/tun already exists, avoid creating it if it's already present
7
+ if [ ! -c /dev/net/tun ]; then
8
+ echo "/dev/net/tun not found, unable to create it as non-root user. Ensure the hosting environment provides the tun device."
9
+ exit 1
10
+ fi
11
 
12
+ # start dbus (if applicable)
13
  mkdir -p /run/dbus
14
  if [ -f /run/dbus/pid ]; then
15
  rm /run/dbus/pid