mirror: Shellcheck fixes for sync-mirrors

This commit is contained in:
Timo Makinen 2020-11-13 05:35:41 +00:00
parent 5f8723c9c9
commit 7fc06236e4

View file

@ -15,7 +15,7 @@ logmsg() {
}
if [ -d ${CONFDIR} ]; then
MIRRORLIST="$(find ${CONFDIR}/ -name \*.conf | while read f ; \
MIRRORLIST="$(find ${CONFDIR}/ -name \*.conf | while read -r f ; \
do basename "${f}" | sed -e 's/\.conf$//' ; done)"
if [ "${MIRRORLIST}" = "" ]; then
echo "ERR: No configured mirrors found" 1>&2
@ -80,18 +80,12 @@ fi
umask 022
if [ -f "${LOCKFILE}" ]; then
kill -0 "$(cat ${LOCKFILE})"
if [ $? -ne 1 ]; then
which stat > /dev/null 2>&1
if [ $? -eq 0 ]; then
STARTED=" ($(stat --format='%y' ${LOCKFILE}))"
else
STARTED=""
fi
if kill -0 "$(cat ${LOCKFILE})" ; then
STARTED=" ($(stat --format='%y' ${LOCKFILE}))"
echo "ERR: Lockfile exists${STARTED}, exiting" 1>&2
exit 1
else
echo "WARN: Removing stale lock file..." 1>&2
echo "WARN: Removing stale lock file..." 1>&2
rm -f "${LOCKFILE}"
fi
fi