codekasten/test/exec_crypt_or_timeout.sh

23 lines
488 B
Bash
Raw Normal View History

2007-10-16 01:50:01 +02:00
#!/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);