Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # script name: extractisos.sh
- # script ver : 0.1 beta.
- # Requirements:
- # - BASH
- # - 7-Zip
- # - sed
- #
- # Created by Fernando Lopez Jr. <fernando*lopezjrATgmail*com>
- # (replace asterisks with dots.)
- EXTRACT_FOLDER=./extracted
- FILES=*.iso
- for FILE in $FILES
- do
- ISO_FILE=$FILE
- ISO_FILENAME=${FILE%.*}
- echo ""
- echo ""
- echo "-> Processing $ISO_FILE file..."
- echo "creating $ISO_FILENAME directory."
- mkdir -p $EXTRACT_FOLDER/$ISO_FILENAME
- echo "extracting iso..."
- 7z x $ISO_FILE -o$EXTRACT_FOLDER/$ISO_FILENAME/
- done
- echo "creating folder list: dirlist.txt"
- pushd $EXTRACT_FOLDER/
- ls -d */ | cut -f1 -d'/' > dirlist.txt
- echo "adding path to each directory entry."
- sed -i "s/^/\\\pathto\\\data\\\/" dirlist.txt
- popd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement