summaryrefslogtreecommitdiff
path: root/components/9990-misc-helpers.sh
diff options
context:
space:
mode:
authorEvgeni Golov <evgeni@grml.org>2014-03-29 14:37:07 +0100
committerDaniel Baumann <daniel@127011.net>2014-03-29 14:37:27 +0100
commit28ca8298a10702e391e420975205a98450d4cf7d (patch)
tree381d84f38e40bc4f67bb2d7fd10fd179f46e0033 /components/9990-misc-helpers.sh
parente31d7cec9e48617a7509bab38cac32958f431d4e (diff)
downloadlive-boot-28ca8298a10702e391e420975205a98450d4cf7d.tar.gz
live-boot-28ca8298a10702e391e420975205a98450d4cf7d.zip
Do not throw warnings when /tmp/custom_mounts.list does not exist.
When no device for an overlay can be found, /tmp/custom_mounts.list won't be created and will produce warnings while booting: sort: /tmp/custom_mounts.list: No such file or directory rm: can't remove '/tmp/custom_mounts.list': No such file or directory Properly handle this case by calling rm with the -f option and calling sort only when the file exists.
Diffstat (limited to 'components/9990-misc-helpers.sh')
-rwxr-xr-xcomponents/9990-misc-helpers.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh
index c656f23..2bf2db1 100755
--- a/components/9990-misc-helpers.sh
+++ b/components/9990-misc-helpers.sh
@@ -1422,7 +1422,7 @@ get_custom_mounts ()
prev_dest=""
# This sort will ensure that a source /a comes right before a source
# /a/b so we only need to look at the previous source
- sort -k2 -b ${custom_mounts} |
+ [ -e ${custom_mounts} ] && sort -k2 -b ${custom_mounts} |
while read device source dest options
do
if echo ${source} | grep -qe "^${prev_source}\(/.*\)\?$"