Add ps3_decrypt.sh
This commit is contained in:
parent
0f6862c1df
commit
44889a12a1
65
ps3_decrypt.sh
Normal file
65
ps3_decrypt.sh
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
TODO_DIR="/home/$USER/Downloads/PS3/PS3ISO/"
|
||||||
|
DONE_DIR="/home/$USER/Downloads/PS3/PS3ISO/READY/"
|
||||||
|
|
||||||
|
if [ ! -d "$TODO_DIR" ]; then
|
||||||
|
mkdir "$TODO_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "$DONE_DIR" ]; then
|
||||||
|
mkdir "$DONE_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $# -eq 0 ]]; then
|
||||||
|
set -- *.zip
|
||||||
|
fi
|
||||||
|
|
||||||
|
for file in "$@"
|
||||||
|
do
|
||||||
|
if [[ ! "$file" =~ \.zip$ ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$file" == "-d" ]] || [[ "$file" == "--keep" ]] || [[ "$file" == "-k" ]]; then
|
||||||
|
delete_zip=false
|
||||||
|
shift
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$file" == "-dkey="* ]]; then
|
||||||
|
dkey=$(echo "$file" | cut -d= -f2)
|
||||||
|
shift
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
extracted_file=$(zipinfo -1 "$file" "*.iso" | grep -i '\.iso$')
|
||||||
|
unzip -j -o -q "$file" "*.iso" -d "$TODO_DIR"
|
||||||
|
|
||||||
|
clear
|
||||||
|
filename=$(basename "$extracted_file")
|
||||||
|
done_file="$DONE_DIR/$filename"
|
||||||
|
|
||||||
|
if [[ -n "$dkey" ]]; then
|
||||||
|
if libray -i "$extracted_file" -o "$done_file" -k "$dkey"; then
|
||||||
|
echo "File processed successfully"
|
||||||
|
rm -rf "$extracted_file"
|
||||||
|
rm -rf "$dkey"
|
||||||
|
rename 's/ \(.*\)//' "$done_file"
|
||||||
|
else
|
||||||
|
echo "Error processing file"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if libray -i "$extracted_file" -o "$done_file"; then
|
||||||
|
echo "File processed successfully"
|
||||||
|
rm -rf "$extracted_file"
|
||||||
|
rename 's/ \(.*\)//' "$done_file"
|
||||||
|
else
|
||||||
|
echo "Error processing file"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$delete_zip" != "false" ]]; then
|
||||||
|
rm -rf "$file"
|
||||||
|
fi
|
||||||
|
done
|
Loading…
x
Reference in New Issue
Block a user