sudo expect << EOF spawn certbot --nginx expect { "Enter email address" { send "iuxt@qq.com\n";exp_continue} "Please read the Terms of Service" {send "A\n";exp_continue} "Would you be willing to share your email address" {send "N\n";exp_continue} "Which names would you like to activate HTTPS for" {send "\n";exp_continue} "You have an existing certificate that has exactly the same domains" {send "1\n";exp_continue} "Please choose whether or not to redirect HTTP traffic to HTTPS" {send "2\n";exp_continue} eof }