Browse Source

improved user experience

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

23
functions/command_fastdl.sh

@ -55,21 +55,25 @@ fn_scriptlog "Initiating FastDL creation"
# Check and create folders # Check and create folders
if [ ! -d "${webdir}" ]; then if [ ! -d "${webdir}" ]; then
fn_printdots "Creating www directory..." fn_printinfo "Creating FastDL directories..."
sleep 0.5 echo -en "\n"
mkdir "${webdir}"
sleep 1 sleep 1
fn_printdots "Creating ${webdir} directory."
mkdir "${webdir}"
fn_printok
fn_scriptlog "FastDL created ${webdir}" fn_scriptlog "FastDL created ${webdir}"
sleep 1
echo -en "\n"
fi fi
if [ ! -d "${fastdldir}" ]; then if [ ! -d "${fastdldir}" ]; then
# No folder, won't ask for removing old ones # No folder, won't ask for removing old ones
newfastdl=1 newfastdl=1
fn_printdots "Creating FastDL directory..." fn_printdots "Creating FastDL directory..."
sleep 0.5
mkdir "${fastdldir}"
sleep 1 sleep 1
mkdir "${fastdldir}"
fn_scriptlog "FastDL created ${fastdldir}" fn_scriptlog "FastDL created ${fastdldir}"
fn_printok "Folders created" fn_printok "Folders created"
sleep 1
echo -en "\n" echo -en "\n"
else else
# Used to prompt for removing old files # Used to prompt for removing old files
@ -81,8 +85,8 @@ fn_fastdl_config(){
# Global settings for FastDL creation # Global settings for FastDL creation
fn_printinfo "Entering configuration" fn_printinfo "Entering configuration"
fn_scriptlog "Configuration" fn_scriptlog "Configuration"
echo -en "\n"
sleep 2 sleep 2
echo -en "\n"
# Prompt for clearing old files if folder was already here # Prompt for clearing old files if folder was already here
if [ ${newfastdl} == 0 ]; then if [ ${newfastdl} == 0 ]; then
fn_printdots fn_printdots
@ -123,7 +127,7 @@ while true; do
[Nn]* ) luaressource="off"; "DL enforcer Disabled"; fn_printok "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 sleep 1
echo -en "\n" echo -en "\n"
done done
} }
@ -137,6 +141,7 @@ if [ ${clearoldfastdl} == "on" ]; then
rm -R "${fastdldir}"/* rm -R "${fastdldir}"/*
fn_printok "Old FastDL folder cleared" fn_printok "Old FastDL folder cleared"
fn_scriptlog "Old FastDL folder cleared" fn_scriptlog "Old FastDL folder cleared"
sleep 1
echo -en "\n" echo -en "\n"
fi fi
} }
@ -296,10 +301,10 @@ fn_fastdl_completed(){
# Finished message # Finished message
fn_printok "Congratulations, it's done" fn_printok "Congratulations, it's done"
fn_scriptlog "FastDL job done" fn_scriptlog "FastDL job done"
echo "For more information, see https://github.com/dgibbs64/linuxgsm/wiki/Fastdl"
echo -en "\n" echo -en "\n"
echo "For more information, see https://github.com/dgibbs64/linuxgsm/wiki/Fastdl"
if [ "$bzip2installed" == "0" ]; then if [ "$bzip2installed" == "0" ]; then
echo "By the way, you'd better install bzip2 an re-run this command" echo "By the way, you'd better install bzip2 an re-run this command !"
fi fi
} }

Loading…
Cancel
Save