diff --git a/bin/exitchk b/bin/exitchk new file mode 100644 index 0000000..05b5766 --- /dev/null +++ b/bin/exitchk @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +exitchk () { + if [ ! $opt = "exit" ]; then null=0 + else exit + fi +} \ No newline at end of file diff --git a/bin/menu b/bin/menu new file mode 100644 index 0000000..fe480dc --- /dev/null +++ b/bin/menu @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +menu () { + while [ active=1 ]; do + title + echo "Please select a Entry" + echo "" + shopt -s nullglob + moduleCat=(./modules/*) + x=0 + for entry in "${moduleEnt[@]}"; do + if [[ -d $entry ]]; then echo "$x:d - $entry" + else [[ -f $entry ]]; then echo "$x:f - $entry" + fi + x=$((x+1)) + done + echo "exit" + read opt + exitchk + entSelect=`echo ${moduleEnt[$opt]} | sed 's|./modules/|../|'` + submenu + clear + done +} + +submenu () { + clear + while true; do + title + echo "Please select an Option from the $entSelect Category" + echo "" + shopt -s nullglob + moduleOpt=($moduleEnt[$opt]) + x=0 + for module in "${moduleOpt[@]}"; do + echo "$x - $module" + x=$((x+1)) + done + echo "back" + read opt + exitchk + clear + done +} \ No newline at end of file diff --git a/bin/title b/bin/title new file mode 100644 index 0000000..afe412e --- /dev/null +++ b/bin/title @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +#EOF allows the contents inside of be displayed as is and not affect the rest of the script +IFS='' read -r -d '' VAR <<-'EOF' +////////////////////////////////////////////////////////////////////////////// +\ ______ _ __ / +\ |_ _ `. (_) | ] / +\ .--. _ .--. .---. _ .--. | | `. \ __ _ .--. ______ .--.| | / +\ / .'`\ \[ '/'`\ \/ /__\\[ `.-. | | | | |[ | [ `/'`\]|______|/ /'`\' | / +\ | \__. | | \__/ || \__., | | | | _| |_.' / | | | | | \__/ | / +\ '.__.' | ;.__/ '.__.'[___||__]|______.' [___][___] '.__.;__] / +\ [__| / +////////////////////////////////////////////////////////////////////////////// + Version 1.0 + A Bash Script For Downloading Open Directories Using Wget + Written by HMSheets + +------------------------------------------------------------------------------- +EOF + +title() { + echo "$VAR" +} \ No newline at end of file diff --git a/modules/wget/wget-dl_nc_np_norobots b/modules/wget/wget-dl_nc_np_norobots new file mode 100644 index 0000000..228f78a --- /dev/null +++ b/modules/wget/wget-dl_nc_np_norobots @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +wget -e robots=off -r -nc -np $downDir $directory \ No newline at end of file diff --git a/modules/wget/wget-dl_nc_np_norobots_typeaccept b/modules/wget/wget-dl_nc_np_norobots_typeaccept new file mode 100644 index 0000000..83f712e --- /dev/null +++ b/modules/wget/wget-dl_nc_np_norobots_typeaccept @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +wget-dlaccept () { + moduleName="Wget-DL Accept File Type" + moduleVersion="0.1.0" + moduleToolUsed="Wget" + + echo "Please provide the filetypes you would like to filter seaperated with a ','. (mkv,mp4,jpg,etc)" + read fileTypes + echo "Please provide the path to the file or directory you would like to download" + read directory + wget -e robots=off -r -nc -np --accept $downDir $directory + echo "Directory Download Complete!" +} \ No newline at end of file diff --git a/openDir-d b/openDir-d old mode 100644 new mode 100755 index 1d6bdb7..a30bc4a --- a/openDir-d +++ b/openDir-d @@ -1,7 +1,5 @@ #!/usr/bin/env bash -#TestComment - #A fancy little wget script for downloading Open Directories #preset wget options @@ -23,28 +21,6 @@ autoCloseMSG="Do you want the terminal to auto close upon task completion? y|n" fileTypeMSG="Please provide the filetypes you would like to filter seaperated with a ','. (mkv,mp4,jpg,etc)" custDownDirMSG="Please provide your custom Download Directory" -#EOF allows the contents inside of be displayed as is and not affect the rest of the script -IFS='' read -r -d '' VAR <<-'EOF' -////////////////////////////////////////////////////////////////////////////// -\ ______ _ __ / -\ |_ _ `. (_) | ] / -\ .--. _ .--. .---. _ .--. | | `. \ __ _ .--. ______ .--.| | / -\ / .'`\ \[ '/'`\ \/ /__\\[ `.-. | | | | |[ | [ `/'`\]|______|/ /'`\' | / -\ | \__. | | \__/ || \__., | | | | _| |_.' / | | | | | \__/ | / -\ '.__.' | ;.__/ '.__.'[___||__]|______.' [___][___] '.__.;__] / -\ [__| / -////////////////////////////////////////////////////////////////////////////// - Version 1.0 - A Bash Script For Downloading Open Directories Using Wget - Written by HMSheets - -------------------------------------------------------------------------------- -EOF - -title() { - echo "$VAR" -} - #main script start while true; do clear diff --git a/openDir-d2 b/openDir-d2 new file mode 100755 index 0000000..902d030 --- /dev/null +++ b/openDir-d2 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +. ./bin/title +. ./bin/menu +. ./bin/exitchk + +clear +menu \ No newline at end of file