make more of the shell pass lints

This commit is contained in:
xichengliudui
2019-02-18 00:42:46 -05:00
parent 07a5488b2a
commit fd044c5770
3 changed files with 11 additions and 13 deletions

View File

@@ -17,14 +17,14 @@
echo "Removing empty directories from etcd..."
cleanup_empty_dirs () {
if [ "$(${ETCDCTL} ls $1)" ]; then
for SUBDIR in $(${ETCDCTL} ls -p $1 | grep "/$")
if [ "$("${ETCDCTL}" ls "${1}")" ]; then
for SUBDIR in $("${ETCDCTL}" ls -p "${1}" | grep "/$")
do
cleanup_empty_dirs ${SUBDIR}
cleanup_empty_dirs "${SUBDIR}"
done
else
echo "Removing empty key $1 ..."
${ETCDCTL} rmdir $1
"${ETCDCTL}" rmdir "${1}"
fi
}
@@ -33,5 +33,5 @@ do
echo "Starting cleanup..."
cleanup_empty_dirs "/registry"
echo "Done with cleanup."
sleep ${SLEEP_SECOND}
sleep "${SLEEP_SECOND}"
done