diff options
author | toni <matzeton@googlemail.com> | 2016-12-26 14:30:11 +0100 |
---|---|---|
committer | toni <matzeton@googlemail.com> | 2016-12-26 14:57:21 +0100 |
commit | c5a9d164b14e3ee015df264919302e772212a7b4 (patch) | |
tree | 6b0deeac99a14385b6eacdf43e993f9e340c63f1 | |
parent | 24fabe15d8f3d79bb7fae3f09c164ccb19768b61 (diff) |
blah
-rwxr-xr-x | scripts/naskpass.initscript | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/naskpass.initscript b/scripts/naskpass.initscript index 5a4f4ca..b92381f 100755 --- a/scripts/naskpass.initscript +++ b/scripts/naskpass.initscript @@ -320,9 +320,11 @@ setup_mapping() message "cryptsetup: maximum number of tries exceeded for $crypttarget" message "shutdown in 3 seconds" sleep 3 - /bin/echo 'o' > /proc/sysrq-trigger + [ -w /proc/sysrq-trigger ] && /bin/echo 'o' > /proc/sysrq-trigger + [ -w /proc/sysrq ] && /bin/echo 'o' > /proc/sysrq + [ -x /sbin/poweroff ] && /sbin/poweroff -n -f sleep 10 - break + return 1 fi continue else @@ -334,7 +336,7 @@ setup_mapping() if [ ! -e "$NEWROOT" ]; then message "cryptsetup: unknown error setting up device mapping" - continue + return 1 fi #FSTYPE='' @@ -380,6 +382,11 @@ setup_mapping() break done + if [ $crypttries -gt 0 ] && [ $count -gt $crypttries ]; then + message "cryptsetup: maximum number of tries exceeded for $crypttarget" + return 1 + fi + udev_settle return 0 } |