Browse Source

adding unzip functionality

pull/1010/head
Alexander Hurd 9 years ago
parent
commit
13b18a5916
  1. 7
      lgsm/functions/check_deps.sh
  2. 4
      lgsm/functions/core_dl.sh

7
lgsm/functions/check_deps.sh

@ -188,6 +188,9 @@ if [ -n "$(command -v dpkg-query)" ]; then
else
array_deps_required+=( libsdl1.2debian bzip2 )
fi
# Unreal Tournament
elif [ "${gamename}" == "Unreal Tournament" ]; then
array_deps_required+=( unzip )
fi
fn_deps_email
fn_check_loop
@ -243,6 +246,10 @@ elif [ -n "$(command -v yum)" ]; then
else
array_deps_required+=( SDL.i686 bzip2 )
fi
# Unreal Tournament
elif [ "${gamename}" == "Unreal Tournament" ]; then
array_deps_required+=( unzip )
fi
fi
fn_deps_email
fn_check_loop

4
lgsm/functions/core_dl.sh

@ -44,7 +44,7 @@ fn_dl_md5(){
fi
}
# Extracts bzip2 or gzip files
# Extracts bzip2 or gzip or zip files
# Extracts can be defined in code like so:
# fn_dl_extract "${filedir}" "${filename}" "${extractdir}"
# fn_dl_extract "/home/gameserver/lgsm/tmp" "file.tar.bz2" "/home/gamserver/serverfiles"
@ -61,6 +61,8 @@ fn_dl_extract(){
tarcmd=$(tar -zxf "${filedir}/${filename}" -C "${extractdir}")
elif [ "${mime}" == "application/x-bzip2" ]; then
tarcmd=$(tar -jxf "${filedir}/${filename}" -C "${extractdir}")
elif [ "${mime}" == "application/zip" ]; then
tarcmd=$(unzip -d "${extractdir}" "${filedir}/${filename}")
fi
local exitcode=$?
if [ ${exitcode} -ne 0 ]; then

Loading…
Cancel
Save