httpd在bash中作为第二个命令重新加载失败

我试图运行一个命令,执行一个动作,更新证书,然后重新加载Apache。

要做到这一点,我运行以下:

sudo /home/ec2-user/letsencrypt/letsencrypt-auto --config /home/ec2-user/letsencrypt/cert.ini certonly --debug && service httpd reload 

这给了我以下内容:

 Updating letsencrypt and virtual environment dependencies...... Requesting root privileges to run with virtualenv: /root/.local/share/letsencrypt/bin/letsencrypt --config /home/ec2-user/letsencrypt/secure_textinconfidence_com.ini certonly --debug Version: 1.1-20080819 Version: 1.1-20080819 IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/secure.textinconfidence.com/fullchain.pem. Your cert will expire on 2016-05-03. To obtain a new version of the certificate in the future, simply run Let's Encrypt again. - If you like Let's Encrypt, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le Reloading httpd: not reloading due to configuration syntax error [FAILED] 

但是,当我运行:

 sudo service httpd configtest 

我得到:

 Syntax OK 

与证书更新结合使用时,我的命令是否有问题?

正如@chicks所说的,shell是在没有sudo的情况下解释&&部分:

 sudo /home/ec2-user/letsencrypt/letsencrypt-auto --config /home/ec2-user/letsencrypt/cert.ini certonly --debug && sudo service httpd reload 

sorting问题