Compare commits
2 Commits
2d51e2001d
...
7fc3465d56
Author | SHA1 | Date |
---|---|---|
|
7fc3465d56 | |
|
5dbe26fc60 |
|
@ -11,4 +11,4 @@ smtp_mynetworks:
|
||||||
- '[2605:6000:3ccd:da01::]/64'
|
- '[2605:6000:3ccd:da01::]/64'
|
||||||
- 172.30.0.240/28
|
- 172.30.0.240/28
|
||||||
- 172.31.1.0/24
|
- 172.31.1.0/24
|
||||||
- 172.30.0.160/28
|
- 172.30.0.160/27
|
||||||
|
|
|
@ -1,18 +1,30 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# vim: set sw=4 ts=4 sts=4 et :
|
||||||
|
|
||||||
QFILE="${HOME}"/createrepo.queue
|
QFILE="${HOME}"/createrepo.queue
|
||||||
REPOS_ROOT="${HOME}"/repos
|
REPOS_ROOT="${HOME}"/repos
|
||||||
|
|
||||||
|
wait_queue() {
|
||||||
|
inotifywait \
|
||||||
|
--event close_write \
|
||||||
|
--include "${QFILE##*/}" \
|
||||||
|
"${QFILE%/*}"
|
||||||
|
}
|
||||||
|
|
||||||
createrepo_loop() {
|
createrepo_loop() {
|
||||||
while sleep 30; do
|
while wait_queue; do
|
||||||
[ -f "${QFILE}" ] || continue
|
while [ -f "${QFILE}" ]; do
|
||||||
mv "${QFILE}" "${QFILE}.work"
|
sleep 10
|
||||||
sort -u "${QFILE}.work" > "${QFILE}.sorted"
|
flock "${QFILE}" mv "${QFILE}" "${QFILE}.work"
|
||||||
while read dir; do
|
sort -u "${QFILE}.work" > "${QFILE}.sorted"
|
||||||
printf 'Generating repository metadata for %s\n' "${dir}"
|
while read dir; do
|
||||||
createrepo_c "${dir}"
|
if [ -d "${dir}" ]; then
|
||||||
done < "${QFILE}.sorted"
|
printf 'Generating repository metadata for %s\n' "${dir}"
|
||||||
rm -f "${QFILE}.work" "${QFILE}.sorted"
|
createrepo_c "${dir}"
|
||||||
|
fi
|
||||||
|
done < "${QFILE}.sorted"
|
||||||
|
rm -f "${QFILE}.work" "${QFILE}.sorted"
|
||||||
|
done
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue