fix script syntax (#11)

This commit is contained in:
练亮斌 2021-12-03 13:58:59 +08:00 committed by GitHub
parent ca883423e0
commit 78486bda49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 12 deletions

View File

@ -22,15 +22,9 @@ install(){
exit 1
fi
local cachev
[ -z "$cache" ] || cachev='-v "'"$cache:/config/transcodes"'"'
[ -z "$port" ] && port=8096
local mediav
[ -z "$media" ] || mediav='-v "'"$media:/media"'"'
docker run --restart=unless-stopped -d \
local cmd="docker run --restart=unless-stopped -d \
--device /dev/rpc0:/dev/rpc0 \
--device /dev/rpc1:/dev/rpc1 \
--device /dev/rpc2:/dev/rpc2 \
@ -53,7 +47,17 @@ install(){
-v /var/tmp/vowb:/var/tmp/vowb \
--pid=host \
--dns=172.17.0.1 \
-p $port:8096 -v "$config:/config" $cachev $mediav -v /mnt:/mnt:rslave --name myjellyfin-rtk "$image_name"
-p $port:8096 -v \"$config:/config\""
[ -z "$cache" ] || cmd="$cmd -v \"$cache:/config/transcodes\""
[ -z "$media" ] || cmd="$cmd -v \"$media:/media\""
cmd="$cmd -v /mnt:/mnt"
mountpoint -q /mnt && cmd="$cmd:rslave"
cmd="$cmd --name myjellyfin-rtk \"$image_name\""
echo "$cmd" >&2
eval "$cmd"
}

View File

@ -12,8 +12,9 @@ install(){
exit 1
fi
[ -z "$port" ] && port=8081
docker run -d --name kodexplorer -p $port:80 -v $cache:/var/www/html -v /mnt:/mnt:rslave $image_name
local mntv="/mnt:/mnt"
mountpoint -q /mnt && mntv="$mntv:rslave"
docker run -d --name kodexplorer -p $port:80 -v $cache:/var/www/html -v $mntv $image_name
}