blob: 36bdee1fa83d8259d89e43a27aa44fe93fd0d94f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/usr/bin/expect
set keyfile [lindex $argv 1]
set certfile [lindex $argv 2]
set timeout 2
spawn openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -keyout "${keyfile}" -out "${certfile}"
expect "Country Name (2 letter code) \[XX\]:"
set timeout 1
send "US\r"
expect "State or Province Name (full name) \[\]:"
send "Some State\r"
expect "Locality Name (eg, city) \[Default City\]:"
send "Default City\r"
expect "Organization Name (eg, company) \[Default Company Ltd\]:"
send "Default Company Ltd\r"
expect "Organizational Unit Name (eg, section) \[\]:" &&
send "Information Technologies\r"
expect "Common Name (eg, your name or your server's hostname) \[\]:"
send [lindex $argv 0]
send "\r"
expect "Email Address \[\]:"
send "linuxadmin@example.com\r"
interact
|