more verbosity, fixing wrong info.cfg file
This commit is contained in:
13
split-dl.sh
13
split-dl.sh
@@ -78,7 +78,7 @@ FOLDER="dl-$FILE"
|
||||
|
||||
checkfolder $FOLDER
|
||||
|
||||
INFO="$FOLDER/$INFO.cfg"
|
||||
INFO="$FOLDER/$INFO"
|
||||
|
||||
BIGNAME=$(basename $FILE)
|
||||
BIGSIZE=$(du $FILE | awk -F" " '{ print $1 }')
|
||||
@@ -89,14 +89,16 @@ echo "BIGSIZE=$BIGSIZE" >> $INFO
|
||||
echo "BIGMD5=$BIGMD5" >> $INFO
|
||||
echo >> $INFO
|
||||
|
||||
split -a 4 -b $SPLITSIZE $FILE $FOLDER/dl-
|
||||
echo "[INFO] Splitting big file into smaller parts..."
|
||||
split --verbose -a 4 -b $SPLITSIZE $FILE $FOLDER/dl-
|
||||
|
||||
# List all splitted files, measure size and md5sum
|
||||
SMALLNO=$(ls $FOLDER | grep -v info.cfg | wc -l)
|
||||
echo "[INFO] Creating info document with necessary specs..."
|
||||
SMALLNO=$(ls $FOLDER | grep -v $INFO | wc -l)
|
||||
echo "SMALLNO=$SMALLNO" >> $INFO
|
||||
|
||||
NO=0
|
||||
ls $FOLDER | grep -v info.cfg | while read -r line; do
|
||||
ls $FOLDER | grep -v $INFO | while read -r line; do
|
||||
|
||||
SMALLNAME=$line
|
||||
SMALLSIZE=$(du $FOLDER/$SMALLNAME | awk -F" " '{ print $1 }')
|
||||
@@ -109,7 +111,8 @@ ls $FOLDER | grep -v info.cfg | while read -r line; do
|
||||
let NO=NO+1
|
||||
done
|
||||
|
||||
echo "[SUCCESS] You can now download the splitted files with the client function of this program! \nPlease move the folder \"$FOLDER\" to an web-accessible directory and use this folder as the first argument for this script."
|
||||
echo "[SUCCESS] You can now download the splitted files with the client function of this program!"
|
||||
echo "[INFO] Please move the folder \"$FOLDER\" to a web-accessible directory and use this folder as the first argument for this script."
|
||||
|
||||
fi # /SERVER MODE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user