|
70 | 70 | apache_config=$(cat "$source_dir/templates/without-ssl.conf");
|
71 | 71 | fi
|
72 | 72 |
|
| 73 | +##################################### |
| 74 | +# STEP 2 - GENERATE CONFIG FILENAME # |
| 75 | +##################################### |
| 76 | + |
| 77 | +if [[ $verbose_mode == "yes" ]]; then |
| 78 | + echo -e "- Generating filename prefix for necessary files..."; |
| 79 | +fi |
| 80 | + |
| 81 | +filename_prefix="${domain//$filename_prefix_pattern/_}"; |
| 82 | + |
73 | 83 | ##################################
|
74 |
| -# STEP 2 - PROCESS APACHE CONFIG # |
| 84 | +# STEP 3 - PROCESS APACHE CONFIG # |
75 | 85 | ##################################
|
76 | 86 |
|
77 | 87 | if [[ $verbose_mode == "yes" ]]; then
|
|
81 | 91 | apache_config="${apache_config//$domain_pattern/$domain}";
|
82 | 92 | apache_config="${apache_config//$root_dir_pattern/$root_dir}";
|
83 | 93 | apache_config="${apache_config//$server_admin_pattern/$server_admin}";
|
84 |
| -apache_config="${apache_config//$cert_file_pattern/$cert_file}"; |
85 |
| -apache_config="${apache_config//$cert_key_pattern/$cert_key}"; |
86 |
| - |
87 |
| -##################################### |
88 |
| -# STEP 3 - GENERATE CONFIG FILENAME # |
89 |
| -##################################### |
90 |
| - |
91 |
| -if [[ $verbose_mode == "yes" ]]; then |
92 |
| - echo -e "- Generating filename prefix for necessary files..."; |
93 |
| -fi |
94 |
| - |
95 |
| -filename_prefix="${domain//$filename_prefix_pattern/_}"; |
| 94 | +apache_config="${apache_config//$cert_file_pattern/\/etc\/apache2\/ssl\/$filename_prefix.crt}"; |
| 95 | +apache_config="${apache_config//$cert_key_pattern/\/etc\/apache2\/ssl\/$filename_prefix.key}"; |
96 | 96 |
|
97 | 97 | ####################################
|
98 | 98 | # STEP 4 - ADD CONFIGURATION FILES #
|
@@ -125,13 +125,9 @@ if [[ $verbose_mode == "yes" ]]; then
|
125 | 125 | echo -e "- Adding dummy SSL certificates...";
|
126 | 126 | fi
|
127 | 127 |
|
128 |
| -if [ ! -z $cert_file ]; then |
129 |
| - cp $cert_file "/etc/apache2/ssl/$filename_prefix.crt"; |
130 |
| -fi |
| 128 | +cp $cert_file "/etc/apache2/ssl/$filename_prefix.crt"; |
131 | 129 |
|
132 |
| -if [ ! -z $cert_key ]; then |
133 |
| - cp $cert_key "/etc/apache2/ssl/$filename_prefix.key"; |
134 |
| -fi |
| 130 | +cp $cert_key "/etc/apache2/ssl/$filename_prefix.key"; |
135 | 131 |
|
136 | 132 | ##################################
|
137 | 133 | # STEP 7 - CREATE ROOT DIRECTORY #
|
|
0 commit comments