mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-23 17:40:35 +08:00
Update containers_version.sh
This commit is contained in:
parent
d3b19c9522
commit
38506178b4
@ -1,6 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
||||||
|
|
||||||
|
containername=$1
|
||||||
|
imagename=$2
|
||||||
|
|
||||||
# get applist
|
# get applist
|
||||||
if [ -d StackHub ] ; then
|
if [ -d StackHub ] ; then
|
||||||
echo "StackHub is exists"
|
echo "StackHub is exists"
|
||||||
@ -8,6 +11,21 @@ else
|
|||||||
git clone --depth=1 https://github.com/Websoft9/StackHub.git
|
git clone --depth=1 https://github.com/Websoft9/StackHub.git
|
||||||
fi
|
fi
|
||||||
appnames=$(ls StackHub/apps/roles |grep -v Template |grep -v README.md |grep -v role)
|
appnames=$(ls StackHub/apps/roles |grep -v Template |grep -v README.md |grep -v role)
|
||||||
|
|
||||||
for appname in $appnames; do
|
for appname in $appnames; do
|
||||||
echo $character
|
|
||||||
|
if [[ $containername == $appname ]];then
|
||||||
|
echo "$containername容器匹配成功app:$appname"
|
||||||
|
break
|
||||||
|
elif [[ $imagename =~ $appname ]];then
|
||||||
|
tmpvar="-"
|
||||||
|
if [[ $containername =~ $tmpvar ]];then
|
||||||
|
echo "$imagename=镜像匹配成功app:$appname"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "need other mothod "
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "容器镜像均未匹配成功app:$appname"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user