Skip to content

Commit 158c759

Browse files
committed
Slight procedure alteration.
1 parent 9048f06 commit 158c759

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ alias local-domains="/path/to/your/folder/local-domains.sh"
8989
echo alias local-domains="/path/to/your/folder/local-domains.sh" >> ~/.bash_aliases
9090
```
9191

92-
If you have any questions, please don't hessitate to contact me.
92+
```bash
9393
echo alias local-domains="/path/to/your/folder/local-domains.sh" >> ~/.bash_aliases
9494
```
9595

src/includes/add-domain.sh

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,18 @@ else
7070
apache_config=$(cat "$source_dir/templates/without-ssl.conf");
7171
fi
7272

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+
7383
##################################
74-
# STEP 2 - PROCESS APACHE CONFIG #
84+
# STEP 3 - PROCESS APACHE CONFIG #
7585
##################################
7686

7787
if [[ $verbose_mode == "yes" ]]; then
@@ -81,18 +91,8 @@ fi
8191
apache_config="${apache_config//$domain_pattern/$domain}";
8292
apache_config="${apache_config//$root_dir_pattern/$root_dir}";
8393
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}";
9696

9797
####################################
9898
# STEP 4 - ADD CONFIGURATION FILES #
@@ -125,13 +125,9 @@ if [[ $verbose_mode == "yes" ]]; then
125125
echo -e "- Adding dummy SSL certificates...";
126126
fi
127127

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";
131129

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";
135131

136132
##################################
137133
# STEP 7 - CREATE ROOT DIRECTORY #

src/local-domains.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
##################
3535

3636
source_dir="$(cd "$( dirname "${BASH_SOURCE[0]}")" && pwd)"
37-
version="1.1.2";
37+
version="1.1.3";
3838

3939
###################
4040
# OTHER VARIABLES #

0 commit comments

Comments
 (0)