Created
September 9, 2019 07:18
-
-
Save zdev0x/932811a0997b425469710479ec4e1088 to your computer and use it in GitHub Desktop.
加密压缩打包ssl证书脚本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # filename: archive_ssl.sh | |
| # 压缩文件密码 | |
| PASSWORD="zip_password" | |
| # ssl 归档目录 | |
| SSL_ARCHIVE_DIR="/data/wwwroot/default/export/ssl/" | |
| # 日期 | |
| CUR_DATE=$(date "+%Y%m%d") | |
| pushd /usr/local/openresty/nginx/conf/ssl > /dev/null | |
| CUR_SSL_ZIP="ssl_${CUR_DATE}.zip" | |
| zip -P ${PASSWORD} -r ${CUR_SSL_ZIP} ./ | |
| if [ ! -e $CUR_SSL_ZIP ]; then | |
| echo "ZIP ${CUR_SSL_ZIP} Error"; exit 1; | |
| fi | |
| mv ${CUR_SSL_ZIP} ${SSL_ARCHIVE_DIR} | |
| printf "ZIP:Success\n" | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment