added configPath creation test

This commit is contained in:
Asif Bacchus 2019-01-07 22:36:21 -07:00
parent c42363abfe
commit a22529026a

View File

@ -49,6 +49,7 @@ unset phpAddr
unset phpPort unset phpPort
unset phpSock unset phpSock
unset dhsuccess unset dhsuccess
unset copysuccess
# set variables # set variables
regexIP4="(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])" regexIP4="(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"
@ -657,6 +658,14 @@ echo "copying files to dedicated directory for customization:"
echo -e "${warn}${configPath}${norm}\n" echo -e "${warn}${configPath}${norm}\n"
rm -rf "${configPath}" rm -rf "${configPath}"
cp -R ./etc "${configPath}" cp -R ./etc "${configPath}"
copysuccess=$?
# check that copy was performed, else exit
if [ "${copysuccess}" -ne 0 ] || [ ! -d "${configPath}" ]; then
echo -e "\n${err}There was a problem creating the configuration directory.${norm}"
echo "Is there a reason ROOT cannot write to this script's directory?"
echo -e "${err}No changes made. Exiting.${norm}"
exit 100
fi
# process server_names snippet # process server_names snippet
echo -e "updating ${warn}${configPath}/${file_servernames}${norm}" echo -e "updating ${warn}${configPath}/${file_servernames}${norm}"