mirror: Shellcheck fixes for sync-mirrors
This commit is contained in:
parent
5f8723c9c9
commit
7fc06236e4
1 changed files with 4 additions and 10 deletions
|
@ -15,7 +15,7 @@ logmsg() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -d ${CONFDIR} ]; then
|
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)"
|
do basename "${f}" | sed -e 's/\.conf$//' ; done)"
|
||||||
if [ "${MIRRORLIST}" = "" ]; then
|
if [ "${MIRRORLIST}" = "" ]; then
|
||||||
echo "ERR: No configured mirrors found" 1>&2
|
echo "ERR: No configured mirrors found" 1>&2
|
||||||
|
@ -80,18 +80,12 @@ fi
|
||||||
umask 022
|
umask 022
|
||||||
|
|
||||||
if [ -f "${LOCKFILE}" ]; then
|
if [ -f "${LOCKFILE}" ]; then
|
||||||
kill -0 "$(cat ${LOCKFILE})"
|
if kill -0 "$(cat ${LOCKFILE})" ; then
|
||||||
if [ $? -ne 1 ]; then
|
STARTED=" ($(stat --format='%y' ${LOCKFILE}))"
|
||||||
which stat > /dev/null 2>&1
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
STARTED=" ($(stat --format='%y' ${LOCKFILE}))"
|
|
||||||
else
|
|
||||||
STARTED=""
|
|
||||||
fi
|
|
||||||
echo "ERR: Lockfile exists${STARTED}, exiting" 1>&2
|
echo "ERR: Lockfile exists${STARTED}, exiting" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "WARN: Removing stale lock file..." 1>&2
|
echo "WARN: Removing stale lock file..." 1>&2
|
||||||
rm -f "${LOCKFILE}"
|
rm -f "${LOCKFILE}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue