Moved check for being able to write to the arkserverroot parent directory to the install function

This commit is contained in:
Stuart Whelan 2015-07-11 18:18:04 +12:00
parent 0673866d48
commit b4a4ecbfd4

View File

@ -74,10 +74,6 @@ checkConfig() {
fi
# Environment configuration
# arkserverroot
if [ ! -w `echo "$arkserverroot" | sed 's:/[^/]*$::'` ] ; then
echo -e "[" "$RED" "ERROR" "$NORMAL" "]" "\tYou have not rights to write in the defined ARK server root directory"
fi
# arkserverexec
if [ ! -f "$arkserverroot/$arkserverexec" ] ; then
echo -e "[" "$YELLOW" "WARN" "$NORMAL" "]" "\tYour ARK server exec could not be found."
@ -274,7 +270,16 @@ doStop() {
# install of ARK server
#
doInstall() {
mkdir -p "$arkserverroot"
# Check if arkserverroot already exists
if [ ! -d "$arkserverroot" ]; then
# If it does not exist, try create it
echo -e "Creating the ARK server root directory ($arkserverroot)"
mkdir -p "$arkserverroot"
if [ ! $? ] ; then
echo -e "[" "$RED" "ERROR" "$NORMAL" "]" "\tFailed to create the defined ARK server root directory ($arkserverroot)"
exit 1
fi
fi
cd "$steamcmdroot"
# install the server