blob: 1f69e798d366d8d3243f77958086c2e96c3ac4b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#!/usr/bin/expect
set timeout 2
expect_after default {puts "\nFAIL"; exit 1}
spawn /bin/sh
send "if \[ \$(id -u) -eq 0 \]; then PS1='# '; else PS1='$ '; fi\r"
expect "# "
send "expiry -c\r"
expect "# "
send "echo \$?\r"
expect "3"
expect "# "
send "exit\r"
puts "OK\n"
exit 0
|