Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # USAGE: ./upx
- #
- # DESCRIPTION: Frontend to Various Unpacking Tools
- #
- # OPTIONS: ---
- # REQUIREMENTS: ---
- # BUGS: ---
- # NOTES: ---
- # AUTHOR: Stephen Kane
- # ORGANIZATION:
- # CREATED: 16/02/12 21:35:59 GMT
- # REVISION: v0.1
- # This file has no explicitly declared licence, however the author must retain
- # his default legal rights and therefore BLANKET.LICENCE does not apply here!
- #===============================================================================
- if [[ ! -f $1 ]]; then
- if [[ ! -f $1 ]]; then
- echo "$0: first argument is not a file" >&2
- echo "$0: first argument is not a file" >&2
- exit
- exit
- fi
- FILE="$1"
- FILE="$1"
- FILETYPE=$(if file -b $FILE | grep -q "ACE archive"; then
- FILETYPE=$(if file -b $FILE | grep -q "ACE archive"; then
- echo "ACE"
- echo "ACE"
- elif file -b $FILE | grep -q "RAR archive"; then
- elif file -b $FILE | grep -q "RAR archive"; then
- echo "RAR"
- echo "RAR"
- elif file -b $FILE | grep -q "Zip archive"; then
- elif file -b $FILE | grep -q "Zip archive"; then
- echo "ZIP"
- echo "ZIP"
- fi)
- fi)
- if [[ $FILETYPE == "ACE" ]]; then
- if [[ $FILETYPE == "ACE" ]]; then
- unace e "$FILE"
- unace e "$FILE"
- elif [[ $FILETYPE == "RAR" ]]; then
- elif [[ $FILETYPE == "RAR" ]]; then
- unrar x "$FILE"
- unrar x "$FILE"
- elif [[ $FILETYPE == "ZIP" ]]; then
- elif [[ $FILETYPE == "ZIP" ]]; then
- unzip "$FILE"
- unzip "$FILE"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement