Browse Source

fix newfastDL + user iface

pull/709/head
lrob 9 years ago
parent
commit
687153d889
  1. 23
      functions/command_fastdl.sh

23
functions/command_fastdl.sh

@ -7,7 +7,7 @@ lgsm_version="190216"
# Description: Creates a FastDL folder # Description: Creates a FastDL folder
local modulename="FastDL Creator" local modulename="FastDL"
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
check.sh check.sh
@ -57,7 +57,7 @@ fn_scriptlog "Initiating FastDL creation"
if [ ! -d "${webdir}" ]; then if [ ! -d "${webdir}" ]; then
fn_printdots "Creating www directory..." fn_printdots "Creating www directory..."
sleep 0.5 sleep 0.5
mkdir -v "${webdir}" mkdir "${webdir}"
sleep 1 sleep 1
fn_scriptlog "FastDL created ${webdir}" fn_scriptlog "FastDL created ${webdir}"
fi fi
@ -65,7 +65,7 @@ if [ ! -d "${fastdldir}" ]; then
newfastdl=1 newfastdl=1
fn_printdots "Creating FastDL directory..." fn_printdots "Creating FastDL directory..."
sleep 0.5 sleep 0.5
mkdir -v "${fastdldir}" mkdir "${fastdldir}"
sleep 1 sleep 1
fn_scriptlog "FastDL created ${fastdldir}" fn_scriptlog "FastDL created ${fastdldir}"
fn_printok "Folders created" fn_printok "Folders created"
@ -80,12 +80,10 @@ fn_printinfo "Entering configuration"
fn_scriptlog "Configuration" fn_scriptlog "Configuration"
echo -en "\n" echo -en "\n"
sleep 2 sleep 2
if [ ${newfastdl} == 1 ]; then if [ ${newfastdl} == 0 ]; then
fn_printdots "Enable clearing old FastDL files?" fn_printdots
echo ""
sleep 1
while true; do while true; do
read -p "Clear old FastDL? [y/n]" yn read -p "Clear old FastDL files? [y/n]" yn
case $yn in case $yn in
[Yy]* ) clearoldfastdl="on"; fn_scriptlog "clearoldfastdl enabled"; fn_printok "Clearing Enabled"; break;; [Yy]* ) clearoldfastdl="on"; fn_scriptlog "clearoldfastdl enabled"; fn_printok "Clearing Enabled"; break;;
[Nn]* ) clearoldfastdl="off"; fn_scriptlog "clearoldfastdl disabled"; fn_printok "Clearing Disabled"; break;; [Nn]* ) clearoldfastdl="off"; fn_scriptlog "clearoldfastdl disabled"; fn_printok "Clearing Disabled"; break;;
@ -113,13 +111,12 @@ fi
fn_fastdl_gmod_config(){ fn_fastdl_gmod_config(){
# Prompt for download enforcer, that is using a .lua addfile resource generator # Prompt for download enforcer, that is using a .lua addfile resource generator
echo "Do you wish to force clients to downloading the whole FastDL content?" fn_printdots
echo "It is useful for many addons where devs didn't register their files to be downloaded through FastDL."
while true; do while true; do
read -p "Use download enforcer? [y/n]" yn read -p "Use client download enforcer? [y/n]" yn
case $yn in case $yn in
[Yy]* ) luaressource="on"; fn_scriptlog "DL enforcer Enabled"; fn_printok "DL enforcer Enabled"; break;; [Yy]* ) luaressource="on"; fn_scriptlog "DL enforcer Enabled"; fn_printok "Enforcer Enabled"; break;;
[Nn]* ) luaressource="off"; "DL enforcer Disabled"; fn_printok "DL enforcer Disabled"; break;; [Nn]* ) luaressource="off"; "DL enforcer Disabled"; fn_printok "Enforcer Disabled"; break;;
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
sleep1 sleep1

Loading…
Cancel
Save