diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 13:59:18 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2007-09-23 13:59:18 +0200 |
commit | 9f59f16c7c1da6cd227fa47897dc76bf8004cb8e (patch) | |
tree | e950c610f9e4771a59a4232b6db0a473f4bb0640 /examples | |
parent | 471b32c6821eea5d1a73c62c16eb31defe9c0895 (diff) | |
download | vyos-live-build-9f59f16c7c1da6cd227fa47897dc76bf8004cb8e.tar.gz vyos-live-build-9f59f16c7c1da6cd227fa47897dc76bf8004cb8e.zip |
Only removing old packages if they exist.
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/cron/snapshots.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/cron/snapshots.sh b/examples/cron/snapshots.sh index 2075388c0..e9f97958d 100755 --- a/examples/cron/snapshots.sh +++ b/examples/cron/snapshots.sh @@ -84,10 +84,13 @@ do mkdir -p "${SERVER}" # Removing old packages - for FILE in `awk {'print $5'} "${SERVER}"/"${PACKAGE}"*.changes | grep -e ".*\.deb$" -e ".*\.diff.gz$" -e ".*\.dsc$" -e ".*\.tar.gz$" -e ".*\.udeb$"` - do - rm -f "${SERVER}"/"${FILE}" - done + if [ -f "${SERVER}"/"${PACKAGE}"*.changes ] + then + for FILE in `awk {'print $5'} "${SERVER}"/"${PACKAGE}"*.changes | grep -e ".*\.deb$" -e ".*\.diff.gz$" -e ".*\.dsc$" -e ".*\.tar.gz$" -e ".*\.udeb$"` + do + rm -f "${SERVER}"/"${FILE}" + done + fi rm -f "${SERVER}"/"${PACKAGE}"*.changes |