mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-22 23:50:31 +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}')
|
imagename=$(echo $appinfo |awk -F"%" '{print $2}')
|
||||||
|
|
||||||
for appname in $appnames; do
|
for appname in $appnames; do
|
||||||
# app的版本已经输出
|
|
||||||
if [[ $initdata =~ $appname ]];then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
if [[ $containername == $appname ]];then
|
if [[ $containername == $appname ]];then
|
||||||
|
# app的版本已经输出
|
||||||
|
if [[ $initdata =~ $appname ]];then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
echo "$containername容器匹配成功app:$appname"
|
echo "$containername容器匹配成功app:$appname"
|
||||||
appnames=(${appnames[*]/$appname})
|
appnames=(${appnames[*]/$appname})
|
||||||
initdata="$initdata $appname"
|
initdata="$initdata $appname"
|
||||||
|
@ -31,12 +32,15 @@ for appinfo in $(docker ps --format '{{.Names}}%{{.Image}}'); do
|
||||||
bash /tmp/$appname_get_version.sh $containername
|
bash /tmp/$appname_get_version.sh $containername
|
||||||
break
|
break
|
||||||
elif [[ $imagename =~ $appname ]];then
|
elif [[ $imagename =~ $appname ]];then
|
||||||
tmpvar="-"
|
# app的版本已经输出
|
||||||
if [[ $containername =~ $tmpvar ]];then
|
if [[ $initdata =~ $appname ]];then
|
||||||
echo "$imagename=镜像匹配成功app:$appname"
|
continue
|
||||||
appnames=(${appnames[*]/$appname})
|
fi
|
||||||
initdata="$initdata $appname"
|
tmpvar="-"
|
||||||
wget -O /tmp/$appname_get_version.sh https://raw.githubusercontent.com/Websoft9/docker-$appname/main/src/get_version.sh
|
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
|
bash /tmp/$appname_get_version.sh $containername
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue