codekasten/test/exec_crypt_or_timeout.sh
2007-10-15 23:50:01 +00:00

22 lines
488 B
Bash
Executable file

#!/bin/sh
# \
exec expect -f "$0" ${1+"$@"}
# take commandline value as timeout
#set timeout $argv
set timeout 7
set prog "/etc/init.d/dmcrypt-wrapper.sh"
if {[file executable $prog]} {
set progstart "$prog start"
} else {
send "\"$prog\" not found or is not executable\n"
exit
}
send_user "Press return to activate cryptodevices! "
expect -re \n {
system $progstart
exit
}
send "\n\ttimeout after $timeout seconds - not starting \"$prog\"\n"
exit
#send_user $expect_out(buffer);