1 | #!/bin/bash |
---|
2 | |
---|
3 | DOMAIN_NAME="www.midnight-commander.org" |
---|
4 | |
---|
5 | expect -c ' |
---|
6 | set timeout -1 |
---|
7 | spawn openssl req -new -key midnight-commander.org.key -out midnight-commander.org.csr |
---|
8 | match_max 100000 |
---|
9 | expect "Country Name" |
---|
10 | send -- "MC\r" |
---|
11 | expect "State or Province Name" |
---|
12 | send -- "'${DOMAIN_NAME}'\r" |
---|
13 | expect "Locality Name" |
---|
14 | send -- "'${DOMAIN_NAME}'\r" |
---|
15 | expect "Organization Name" |
---|
16 | send -- "'${DOMAIN_NAME}'\r" |
---|
17 | expect "Organizational Unit Name" |
---|
18 | send -- "'${DOMAIN_NAME}'\r" |
---|
19 | expect "Common Name" |
---|
20 | send -- "'${DOMAIN_NAME}'\r" |
---|
21 | expect "Email Address" |
---|
22 | send -- "\r" |
---|
23 | expect "A challenge password" |
---|
24 | send -- "\r" |
---|
25 | expect "An optional company name" |
---|
26 | send -- "\r" |
---|
27 | expect eof |
---|
28 | ' |
---|