Skip to content

Commit 976014e

Browse files
committed
Updated install script with base folder creations
1 parent 6678bb1 commit 976014e

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

install.sh

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#! /bin/bash
22

33
PATH="$(pwd)"
4-
INSTALLATION="/etc/httpd/commands"
4+
HTTP_PATH="/etc/httpd"
5+
INSTALLATION="$HTTP_PATH/commands"
56
COMPLETIONS_PATH="/usr/share/bash-completion/completions"
67

78
binPath="/usr/bin"
@@ -26,6 +27,21 @@ function _create_folder {
2627
fi
2728
}
2829

30+
function _create_vhost_folder {
31+
vhost=( "sites-enabled" "sites-available" )
32+
for vhost_folder in ${vhost[@]}; do
33+
local folder="$HTTP_PATH/$vhost_folder"
34+
35+
if [ ! -d $folder ]; then
36+
/bin/mkdir $verbose "$folder"
37+
else
38+
if [ -z "$verbose" ]; then
39+
echo "The folder \"$folder\" already exists skipping"
40+
fi
41+
fi
42+
done
43+
}
44+
2945
function _install_commands {
3046
# Install commands
3147
for file in $(/bin/ls -1 "$PATH/commands/"); do
@@ -38,6 +54,8 @@ function _install_commands {
3854
/bin/install $verbose "$INSTALLATION/$file" "$binPath/$file"
3955
fi
4056
done
57+
58+
_create_vhost_folder
4159
}
4260

4361
function _set_autocomplete {

0 commit comments

Comments
 (0)