diff --git a/applications/luci-app-ubuntu/root/usr/share/ubuntu/install.sh b/applications/luci-app-ubuntu/root/usr/share/ubuntu/install.sh index 2eceb24..a1bb25b 100755 --- a/applications/luci-app-ubuntu/root/usr/share/ubuntu/install.sh +++ b/applications/luci-app-ubuntu/root/usr/share/ubuntu/install.sh @@ -10,18 +10,24 @@ install(){ [ -z "$password" ] && password="password" [ -z "$port" ] && port=6901 - docker run -d --name ubuntu \ - --dns=223.5.5.5 -u=0:0 \ - -v=/mnt:/mnt:rslave \ - --net="docker-pcnet" \ - --ip=10.10.100.9 \ - --shm-size=512m \ - -p $port:6901 \ - -e VNC_PW=$password \ - -e VNC_USE_HTTP=0 \ - --restart unless-stopped \ - $image_name - + DOCKERPATH=`uci get dockerman.local.daemon_data_root` + if [[ findmnt -T ${DOCKERPATH} | grep -q /dev/sd ]] ; + docker network ls -f "name=docker-pcnet" | grep -q docker-pcnet || \ + docker network create -d bridge --subnet=10.10.100.0/24 --ip-range=10.10.100.0/24 --gateway=10.10.100.1 docker-pcnet + docker run -d --name ubuntu \ + --dns=223.5.5.5 -u=0:0 \ + -v=/mnt:/mnt:rslave \ + --net="docker-pcnet" \ + --ip=10.10.100.9 \ + --shm-size=512m \ + -p $port:6901 \ + -e VNC_PW=$password \ + -e VNC_USE_HTTP=0 \ + --restart unless-stopped \ + $image_name + then + echo "docker not in disk" + fi }