mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 02:51:55 +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" ]
|
||||
then
|
||||
[ -d ${BASE}/${KEY} ] && exit 0
|
||||
[ -f ${BASE}/${KEY} -a ! -z "$(cat ${BASE}/${KEY})" ] && exit 0
|
||||
exit 1
|
||||
[ -f ${BASE}/${KEY} ] || exit 1
|
||||
VALUE="$(cat ${BASE}/${KEY} | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
|
||||
[ -z "${VALUE}" ] && exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $1 == "dir" ]
|
||||
|
Loading…
Reference in New Issue
Block a user