diff options
author | Harald Hoyer <harald@redhat.com> | 2012-07-30 22:27:53 +0200 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2012-07-30 22:29:47 +0200 |
commit | 3d3c192621861bb82966369d74300c504f6d786f (patch) | |
tree | 954e714458fbe1b684004f16b8ea3bb3d505d35d | |
parent | 92b3ee855f2db13577c04dba584739a10e62368a (diff) | |
download | dracut-3d3c192621861bb82966369d74300c504f6d786f.tar.gz dracut-3d3c192621861bb82966369d74300c504f6d786f.tar.bz2 dracut-3d3c192621861bb82966369d74300c504f6d786f.zip |
crypt/crypt-run-generator.sh: check if crypttab exists
-rwxr-xr-x | modules.d/90crypt/crypt-run-generator.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules.d/90crypt/crypt-run-generator.sh b/modules.d/90crypt/crypt-run-generator.sh index cb3aedc6..f2f2da15 100755 --- a/modules.d/90crypt/crypt-run-generator.sh +++ b/modules.d/90crypt/crypt-run-generator.sh @@ -5,10 +5,11 @@ dev=$1 luks=$2 -while read l rest; do - strstr "${l##luks-}" "${luks##luks-}" && exit 0 -done < /etc/crypttab - +if [ -f /etc/crypttab ]; then + while read l rest; do + strstr "${l##luks-}" "${luks##luks-}" && exit 0 + done < /etc/crypttab +fi echo "$luks $dev" >> /etc/crypttab /lib/systemd/system-generators/systemd-cryptsetup-generator |