crypt/crypt-run-generator.sh: check if crypttab exists

master
Harald Hoyer 2012-07-30 22:27:53 +02:00
parent 92b3ee855f
commit 3d3c192621
1 changed files with 5 additions and 4 deletions

View File

@ -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