mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-25 19:54:38 +00:00
be better at checking strings which aere mainly empty
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
0390b2ba4d
commit
aaebcf5866
@ -38,8 +38,10 @@ KEY=$(echo $2 | sed 's@^/@@')
|
|||||||
if [ $1 == "exists" ]
|
if [ $1 == "exists" ]
|
||||||
then
|
then
|
||||||
[ -d ${BASE}/${KEY} ] && exit 0
|
[ -d ${BASE}/${KEY} ] && exit 0
|
||||||
[ -f ${BASE}/${KEY} -a ! -z "$(cat ${BASE}/${KEY})" ] && exit 0
|
[ -f ${BASE}/${KEY} ] || exit 1
|
||||||
exit 1
|
VALUE="$(cat ${BASE}/${KEY} | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
|
||||||
|
[ -z "${VALUE}" ] && exit 1
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $1 == "dir" ]
|
if [ $1 == "dir" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user