From 1c06996cff4036a838b507ee5a581e9180646be4 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sat, 4 Mar 2017 05:42:19 +0100 Subject: [PATCH] attempt to fix lua enforcer --- lgsm/functions/command_fastdl.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 7179484cd..60c78fa18 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -341,10 +341,10 @@ fn_fastdl_source(){ # Generate lua file that will force download any file into the FastDL directory fn_fastdl_gmod_lua_enforcer(){ - # Remove lua file if luaressource is turned off and file exists + # Clear old lua file if [ -f "${luafastdlfullpath}" ]; then echo -en "removing existing download enforcer: ${luafastdlfile}..." - rm -R "${luafastdlfullpath:?}" + rm "${luafastdlfullpath:?}" exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl @@ -355,9 +355,10 @@ fn_fastdl_gmod_lua_enforcer(){ fn_script_log_pass "removing existing download enforcer ${luafastdlfullpath}" fi fi - # Remove old lua file and generate a new one if user said yes + # Generate new one if user said yes if [ "${luaressource}" == "on" ]; then echo -en "creating new download enforcer: ${luafastdlfile}..." + touch "${luafastdlfullpath}" # Read all filenames and put them into a lua file at the right path find "${fastdldir:?}" \( -type f -name "*.bz2" \) -printf '%P\n' | while read line; do echo "resource.AddFile( "\""${line}"\"" )" >> "${luafastdlfullpath}"