mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-22 15:40:22 +00:00
Update containers_version.sh
This commit is contained in:
parent
52431d030f
commit
2c3ee91cc2
1 changed files with 14 additions and 10 deletions
|
@ -19,11 +19,12 @@ for appinfo in $(docker ps --format '{{.Names}}%{{.Image}}'); do
|
|||
imagename=$(echo $appinfo |awk -F"%" '{print $2}')
|
||||
|
||||
for appname in $appnames; do
|
||||
# app的版本已经输出
|
||||
if [[ $initdata =~ $appname ]];then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $containername == $appname ]];then
|
||||
# app的版本已经输出
|
||||
if [[ $initdata =~ $appname ]];then
|
||||
continue
|
||||
fi
|
||||
echo "$containername容器匹配成功app:$appname"
|
||||
appnames=(${appnames[*]/$appname})
|
||||
initdata="$initdata $appname"
|
||||
|
@ -31,12 +32,15 @@ for appinfo in $(docker ps --format '{{.Names}}%{{.Image}}'); do
|
|||
bash /tmp/$appname_get_version.sh $containername
|
||||
break
|
||||
elif [[ $imagename =~ $appname ]];then
|
||||
tmpvar="-"
|
||||
if [[ $containername =~ $tmpvar ]];then
|
||||
echo "$imagename=镜像匹配成功app:$appname"
|
||||
appnames=(${appnames[*]/$appname})
|
||||
initdata="$initdata $appname"
|
||||
wget -O /tmp/$appname_get_version.sh https://raw.githubusercontent.com/Websoft9/docker-$appname/main/src/get_version.sh
|
||||
# app的版本已经输出
|
||||
if [[ $initdata =~ $appname ]];then
|
||||
continue
|
||||
fi
|
||||
tmpvar="-"
|
||||
if [[ $containername =~ $tmpvar ]];then
|
||||
echo "$imagename=镜像匹配成功app:$appname"
|
||||
initdata="$initdata $appname"
|
||||
wget -O /tmp/$appname_get_version.sh https://raw.githubusercontent.com/Websoft9/docker-$appname/main/src/get_version.sh
|
||||
bash /tmp/$appname_get_version.sh $containername
|
||||
break
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue