Compare commits

...

3 Commits

7 changed files with 106 additions and 23 deletions
Split View
  1. +7
    -0
      bin/exitchk
  2. +48
    -0
      bin/menu
  3. +25
    -0
      bin/title
  4. +3
    -0
      modules/wget/wget-dl_nc_np_norobots
  5. +14
    -0
      modules/wget/wget-dl_nc_np_norobots_typeaccept
  6. +1
    -23
      openDir-d
  7. +8
    -0
      openDir-d2

+ 7
- 0
bin/exitchk View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash

exitchk () {
if [ ! $opt = "exit" ]; then null=0
else exit
fi
}

+ 48
- 0
bin/menu View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash

menu () {
rootDir="./modules"
currentDir="./modules"
previousDir="./modules"
while [ active=1 ]; do
title
echo "Current Dir: $"
echo "Please select and Entry"
echo ""
shopt -s nullglob
lsModDir="$currentDir*"
moduleEnt=($lsModDir)
x=0
for entry in "${moduleEnt[@]}"; do
if [ -d $entry ]; then echo "$x:d - $entry"
elif [ -f $entry ]; then echo "$x:m - $entry"
fi
x=$((x+1))
done
echo "exit"
read opt
exitchk
entSelect=`echo ${moduleEnt[$opt]} | sed 's|\$previousDir|..|'`
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
}

+ 25
- 0
bin/title View File

@@ -0,0 +1,25 @@
#!/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'
//////////////////////////////////////////////////////////////////////////////
\ ______ _ __ /
\ |_ _ `. (_) | ] /
\ .--. _ .--. .---. _ .--. | | `. \ __ _ .--. ______ .--.| | /
\ / .'`\ \[ '/'`\ \/ /__\\[ `.-. | | | | |[ | [ `/'`\]|______|/ /'`\' | /
\ | \__. | | \__/ || \__., | | | | _| |_.' / | | | | | \__/ | /
\ '.__.' | ;.__/ '.__.'[___||__]|______.' [___][___] '.__.;__] /
\ [__| /
\ 2.0 /
//////////////////////////////////////////////////////////////////////////////
Version 2.0
Totally Modular Dude!
A modular bash script for downloading shit
Written by HMSheets
-------------------------------------------------------------------------------
EOF

title() {
echo "$VAR"
}

+ 3
- 0
modules/wget/wget-dl_nc_np_norobots View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash

wget -e robots=off -r -nc -np $downDir $directory

+ 14
- 0
modules/wget/wget-dl_nc_np_norobots_typeaccept View File

@@ -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!"
}

+ 1
- 23
openDir-d View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
#A fancy little wget script for downloading Open Directories
#preset wget options
@@ -21,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


+ 8
- 0
openDir-d2 View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash

. ./bin/title
. ./bin/menu
. ./bin/exitchk

clear
menu

Loading…
Cancel
Save