Warning!

Notice: the grml team is migrating from Mercurial to Git.
Please visit git.grml.org instead!

fix sed option to avoid creation of tmpfiles
authorMichael Prokop <mika@grml.org>
Sun Dec 17 14:54:01 2006 +0100 (23 months ago)
changeset 13af56b1dbfafb
manifestaf56b1dbfafb
parent 1285ce02b9bd47
child 14fb64b7287dfc
tag0.3-19
fix sed option to avoid creation of tmpfiles
debian/changelog
rebuildfstab
--- a/debian/changelog Sat Dec 16 10:36:37 2006 +0100
+++ b/debian/changelog Sun Dec 17 14:54:01 2006 +0100
@@ -1,3 +1,11 @@ grml-rebuildfstab (0.3-18) unstable; urg
+grml-rebuildfstab (0.3-19) unstable; urgency=low
+
+ * Replace sed's '-ie' with '-i' to avoid creation of tmpfiles
+ that don't get cleaned up otherwise.
+ * Remove some rm commands to speed up the script.
+
+ -- Michael Prokop <mika@grml.org> Sun, 17 Dec 2006 14:52:28 +0100
+
grml-rebuildfstab (0.3-18) unstable; urgency=low
* Add check for existing tmpfiles at beginn of script to
--- a/rebuildfstab Sat Dec 16 10:36:37 2006 +0100
+++ b/rebuildfstab Sun Dec 17 14:54:01 2006 +0100
@@ -4,7 +4,7 @@
# Authors: grml-team (grml.org), (c) Klaus Knopper Nov 2002, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Sam Dez 16 10:33:40 CET 2006 [mika]
+# Latest change: Son Dez 17 14:52:25 CET 2006 [mika]
################################################################################
# This script is based on the package rebuildfstab-knoppix_0.5-4 of Klaus Knopper.
# (C) Klaus Knopper Nov 2002
@@ -179,7 +179,6 @@ fi
fi
[ -n "$verbose" ] && echo "Scanning for new harddisks/partitions/devices." >& 2
-rm -f "$TMP"
if [ -n "$remove" ] ; then
removeentries "$ADDEDBYGRML" /etc/fstab > "$TMP"
@@ -252,7 +251,7 @@ fi
fi
# first clean up old fstab.local entry
-sed -ie '/# Begin of fstab.local/,/# End of fstab.local/ d' $TMP
+sed -i '/# Begin of fstab.local/,/# End of fstab.local/ d' $TMP
if [ -r /etc/fstab.local ]; then
[ -n "$verbose" ] && echo "/etc/fstab.local found, adding to /etc/fstab." >& 2
@@ -271,7 +270,6 @@ if [ -r "$MNTFILE" ] ; then
done
grep '^/.*$' $MNTFILE | sort -u > $TMPFILE
cat $TMPFILE > $MNTFILE
- rm -f $TMPFILE
fi
# Make sure we have all /mnt/* directories
@@ -291,7 +289,6 @@ if [ -r "$MNTFILE" ] ; then
if [ -r "$MNTFILE" ] ; then
grep '^/.*$' $MNTFILE | sort -u > $TMPFILE
cat $TMPFILE > $MNTFILE
- rm -f $TMPFILE
fi
rm -f /var/run/rebuildfstab.pid $TMP $TMPFILE