source: oni2aslpt/o2aslpt.sh@ 1105

Last change on this file since 1105 was 1105, checked in by iritscen, 7 years ago

Small bug fix to Mac LPT script.

File size: 2.2 KB
Line 
1#!/bin/bash
2
3MD5_VANILLA="7d96ffd6da21cc3f419e42f7227642fd"
4MD5_FIRST63="50374bed7f84c51bdcdcefd6300ddb84"
5MD5_LAST32="c5e46781d21cd4414e92d91502512500"
6
7echo "Welcome to the Oni 2 (Angel Studios) Layout Patch Tool."
8
9if [ -z "$1" ]; then
10 echo "You need to pass me the path to your ISO of Oni 2. Exiting."
11 exit
12fi
13
14if [ ! -f "$1" ]; then
15 echo "Hmm, there doesn't seem to be any file at the path you passed me. Exiting."
16 exit
17fi
18
19echo "Verifying checksum...."
20
21MD5_INPUT=$(md5 "$1")
22MD5_INPUT=${MD5_INPUT#*= }
23
24if [ $MD5_INPUT != $MD5_VANILLA ]; then
25 if [ $MD5_INPUT == $MD5_FIRST63 ]; then
26 echo "This version is already patched to enabled the first 63 layouts! You should see them in the Load Game menu."
27 elif [ $MD5_INPUT == $MD5_LAST32 ]; then
28 echo "This version is already patched to enabled the last 32 layouts! You should see them in the Load Game menu."
29 else
30 echo "Unknown checksum! Sorry, this ISO isn't what I expected."
31 fi
32
33 echo "Exiting."
34 exit
35fi
36
37echo "You have supplied an unmodified ISO of Oni 2. Do you wish to create a patched copy that enables the first 63 layouts or the last 32? Enter a number from this menu:" | fmt -w 80
38echo "(1) First 63."
39echo "(2) Last 32."
40echo "(anything else) I changed my mind, please exit."
41read the_answer
42if [ -z "$the_answer" ]; then
43 echo "No answer given, so I assume you changed your mind. Exiting."
44 exit
45elif [ "$the_answer" == "1" ]; then
46 echo "Creating patched version..."
47 ./xdelta3mac.exe -ds "$1" patchFromVanTo63.x3d ./oni2dev_ps2_first63layouts.iso
48 echo "Verifying checksum...."
49 MD5_OUTPUT=$(md5 ./oni2dev_ps2_first63layouts.iso)
50 MD5_OUTPUT=${MD5_OUTPUT#*= }
51 if [ $MD5_OUTPUT != $MD5_FIRST63 ]; then
52 echo "Uh-oh, something went wrong! Patch failed. Exiting."
53 exit
54 fi
55elif [ "$the_answer" == "2" ]; then
56 echo "Creating patched version..."
57 ./xdelta3mac.exe -ds "$1" patchFromVanTo32.x3d ./oni2dev_ps2_last32layouts.iso
58 echo "Verifying checksum...."
59 MD5_OUTPUT=$(md5 ./oni2dev_ps2_last32layouts.iso)
60 MD5_OUTPUT=${MD5_OUTPUT#*= }
61 if [ $MD5_OUTPUT != $MD5_LAST32 ]; then
62 echo "Uh-oh, something went wrong! Patch failed. Exiting."
63 exit
64 fi
65fi
66
67echo "Goodbye."
Note: See TracBrowser for help on using the repository browser.