Using shell redirection to truncate rather than additional commands/forks/files, thanks to Justin Pryzby <jpryzby@quoininc.com>.
This commit is contained in:
parent
7fc3e5c0e4
commit
889489c8ce
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
# aliases.sh - internal shell aliases
|
||||
# Copyright (C) 2006-2007 Daniel Baumann <daniel@debian.org>
|
||||
#
|
||||
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
||||
# This is free software, and you are welcome to redistribute it
|
||||
# under certain conditions; see COPYING for details.
|
||||
|
||||
set -e
|
||||
|
||||
Truncate ()
|
||||
{
|
||||
for FILE in ${@}
|
||||
do
|
||||
: > ${FILE}
|
||||
done
|
||||
}
|
|
@ -89,7 +89,7 @@ EOF
|
|||
else
|
||||
# Blank out hosts file, don't remove in case
|
||||
# its a symlink, as in the case of exposedroot mode
|
||||
cat /dev/null > chroot/etc/hosts
|
||||
Truncate chroot/etc/hosts
|
||||
fi
|
||||
|
||||
# Removing stage file
|
||||
|
|
|
@ -80,7 +80,7 @@ case "${1}" in
|
|||
mv chroot/etc/resolv.conf.orig chroot/etc/resolv.conf
|
||||
else
|
||||
# Truncating resolv file
|
||||
cat < /dev/null > chroot/etc/resolv.conf
|
||||
Truncate chroot/etc/resolv.conf
|
||||
fi
|
||||
|
||||
# Removing stage file
|
||||
|
|
|
@ -40,5 +40,5 @@ mkdir -p /var/lib/apt/lists/partial
|
|||
# Truncating logs
|
||||
for FILE in $(find /var/log/ -type f)
|
||||
do
|
||||
cat < /dev/null > $FILE
|
||||
: > ${FILE}
|
||||
done
|
||||
|
|
|
@ -32,5 +32,5 @@ mkdir -p /var/lib/apt/lists/partial
|
|||
# Truncating logs
|
||||
for FILE in $(find /var/log/ -type f)
|
||||
do
|
||||
cat < /dev/null > $FILE
|
||||
: > ${FILE}
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue