pre-req: seafile program dir

This commit is contained in:
Asif Bacchus 2019-05-19 00:33:17 -06:00
parent a52d3ace09
commit 1330cc8e70

View File

@ -383,7 +383,7 @@ while getopts ':5:b:d:l:p:s:u:v:w:' PARAMS; do
done
### Verify script pre-requisties
### Verify script pre-requisites
## If not running as root, display error on console and exit
if [ $(id -u) -ne 0 ]; then
@ -391,20 +391,20 @@ if [ $(id -u) -ne 0 ]; then
exit 3
fi
## Check Seafile webroot
# Ensure Seafile webroot is provided
if [ -z "$ncRoot" ]; then
echo -e "\n${err}The Seafile webroot must be specified (-n parameter)" \
"${normal}\n"
## Check Seafile program directory
# Ensure Seafile program directory is provided
if [ -z "$seafDir" ]; then
echo -e "\n${err}The Seafile program directory must be specified" \
"(-p parameter)${normal}\n"
exit 1
# Ensure Seafile webroot directory exists
elif [ -n "$ncRoot" ]; then
checkExist fd "$ncRoot"
# Ensure Seafile program directory exists
else
checkExist fd "$seafDir"
checkResult="$?"
if [ "$checkResult" = "1" ]; then
# Specified Seafile webroot directory could not be found
echo -e "\n${err}The provided Seafile webroot directory" \
"(-n parameter) does not exist.${normal}\n"
if [ "$checkResult" -eq 1 ]; then
# Specified Seafile program directory could not be found
echo -e "\n${err}The provided Seafile program directory" \
"(-p parameter) does not exist.${normal}\n"
exit 1
fi
fi