2021-12-24 13:10:32 +08:00

48 lines
1017 B
Bash
Executable File

#!/bin/sh
image_name=`uci get ubuntu.@ubuntu[0].image 2>/dev/null`
[ -z "$image_name" ] && image_name="linkease/desktop-ubuntu-arm64:develop"
install(){
local password=`uci get ubuntu.@ubuntu[0].password 2>/dev/null`
local port=`uci get ubuntu.@ubuntu[0].port 2>/dev/null`
[ -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
}
while getopts ":il" optname
do
case "$optname" in
"l")
echo -n $image_name
;;
"i")
install
;;
":")
echo "No argument value for option $OPTARG"
;;
"?")
echo "未知选项 $OPTARG"
;;
*)
echo "Unknown error while processing options"
;;
esac
done