The last patch does not work very well, the script could not show the
prompt or read the password from stdin/stdout.

  Here is yet another patch, using exit. Tested on my sid, works fine.
Please confirm it works, Thanks.

-Rex
--- cryptdisks_start.orig	2009-04-29 22:02:47.000000000 +0800
+++ /usr/sbin/cryptdisks_start	2009-04-30 00:26:01.000000000 +0800
@@ -31,11 +31,11 @@
 	if [ "$1" = "$dst" ]; then
 		found="yes"
 		handle_crypttab_line_start "$dst" "$src" "$key" "$opts" <&3
-		exit 0
+		exit 1
 	fi
 done 3<&1
 
-if [ "$found" = "no" ]; then
+if [ $? = "0" ]; then
 	device_msg "$1" "failed, not found in crypttab"
 fi
 
--- cryptdisks_stop.orig	2009-04-29 22:08:46.000000000 +0800
+++ /usr/sbin/cryptdisks_stop	2009-04-30 00:25:58.000000000 +0800
@@ -27,16 +27,15 @@
 
 log_action_begin_msg "Stopping crypto disk"
 
-found="no"
 egrep -v "^[[:space:]]*(#|$)" "$TABFILE" | while read dst src key opts; do
 	if [ "$1" = "$dst" ]; then
 		found="yes"
 		handle_crypttab_line_stop "$dst" "$src" "$key" "$opts" <&3
-		exit 0
+		exit 1
 	fi
-done 3<&1
+	done 3<&1
 
-if [ "$found" = "no" ]; then
+if [ $? = "0" ]; then
 	device_msg "$1" "failed, not found in crypttab"
 fi
 

Reply via email to