diff options
author | Daniel Baumann <daniel@debian.org> | 2012-12-16 23:56:34 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2012-12-16 23:56:34 +0100 |
commit | 7caf9ed19f28cb2d0591fb8a02e612f9bec7ca9d (patch) | |
tree | dfd34703d9cc2d8bde6a00bf2d700f087f6cd865 /share/hooks | |
parent | 21ac95b9a658e098dc014602b93a71af5bffd7b2 (diff) | |
download | vyos-live-build-7caf9ed19f28cb2d0591fb8a02e612f9bec7ca9d.tar.gz vyos-live-build-7caf9ed19f28cb2d0591fb8a02e612f9bec7ca9d.zip |
Moving removal of backup and temporary files to their own hook script.
Diffstat (limited to 'share/hooks')
-rwxr-xr-x | share/hooks/0140-remove-backup-files.chroot | 14 | ||||
-rwxr-xr-x | share/hooks/0150-remove-temporary-files.chroot | 12 |
2 files changed, 26 insertions, 0 deletions
diff --git a/share/hooks/0140-remove-backup-files.chroot b/share/hooks/0140-remove-backup-files.chroot new file mode 100755 index 000000000..6058f1eb2 --- /dev/null +++ b/share/hooks/0140-remove-backup-files.chroot @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +# Remove backup files +rm -f /etc/apt/trusted.gpg~ + +rm -f /etc/passwd- +rm -f /etc/group- +rm -f /etc/shadow- +rm -f /etc/gshadow- + +rm -f /var/cache/debconf/*-old +rm -f /var/lib/dpkg/*-old diff --git a/share/hooks/0150-remove-temporary-files.chroot b/share/hooks/0150-remove-temporary-files.chroot new file mode 100755 index 000000000..21bc5ee6f --- /dev/null +++ b/share/hooks/0150-remove-temporary-files.chroot @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +# Remove temporary files +for _DIRECTORY in /tmp /var/tmp +do + rm -rf ${_DIRECTORY} + + mkdir -p ${_DIRECTORY} + chmod 1777 ${_DIRECTORY} +done |