mirror of
https://gitlab.com/Nanolx/patchimage.git
synced 2024-12-28 02:01:47 +01:00
wiimmfi.sh: fixes and code review
This commit is contained in:
parent
771831fefc
commit
6092d3f741
@ -22,13 +22,13 @@ Supported Versions: EUR, JAP, USA
|
|||||||
check_input_image_special () {
|
check_input_image_special () {
|
||||||
|
|
||||||
ask_input_image_mkwiimm
|
ask_input_image_mkwiimm
|
||||||
echo -e "type ALL or RMC???.wbfs:\n"
|
echo -e "type RMC???.wbfs:\n"
|
||||||
read ID
|
read -r ID
|
||||||
|
|
||||||
if [[ -f ${PWD}/${ID} ]]; then
|
if [[ -f ${PWD}/${ID} ]]; then
|
||||||
GAMEDIR=${PWD}
|
GAMEDIR="${PWD}"
|
||||||
elif [[ -f ${PATCHIMAGE_WBFS_DIR}/${ID} ]]; then
|
elif [[ -f ${PATCHIMAGE_WBFS_DIR}/${ID} ]]; then
|
||||||
GAMEDIR=${PATCHIMAGE_WBFS_DIR}
|
GAMEDIR="${PATCHIMAGE_WBFS_DIR}"
|
||||||
else echo "invalid user input."
|
else echo "invalid user input."
|
||||||
exit 75
|
exit 75
|
||||||
fi
|
fi
|
||||||
@ -39,43 +39,26 @@ check_input_image_special () {
|
|||||||
download_wiimm () {
|
download_wiimm () {
|
||||||
|
|
||||||
mkdir -p "${HOME}/.patchimage/tools/"
|
mkdir -p "${HOME}/.patchimage/tools/"
|
||||||
cd ${HOME}/.patchimage/tools
|
cd "${HOME}"/.patchimage/tools
|
||||||
rm -rf wiimmfi-patcher/ *.7z*
|
rm -rf wiimmfi-patcher/ ./*.7z*
|
||||||
wget "${DOWNLOAD_LINK}" || ( echo "something went wrong downloading ${DOWNLOAD_LINK}" && exit 57 )
|
wget "${DOWNLOAD_LINK}" || ( echo "something went wrong downloading ${DOWNLOAD_LINK}" && exit 57 )
|
||||||
${UNP} mkw-wiimmfi-patcher.7z >/dev/null ( echo "something went wrong unpacking files" && exit 63 )
|
"${UNP}" mkw-wiimmfi-patcher.7z >/dev/null || ( echo "something went wrong unpacking files" && exit 63 )
|
||||||
mv mkw-wiimmfi-patcher*/ wiimmfi-patcher
|
mv mkw-wiimmfi-patcher*/ wiimmfi-patcher
|
||||||
chmod +x wiimmfi-patcher/*.sh
|
chmod +x wiimmfi-patcher/*.sh
|
||||||
rm *.7z
|
rm ./*.7z
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
patch_wiimm () {
|
patch_wiimm () {
|
||||||
|
|
||||||
cd ${HOME}/.patchimage/tools/wiimmfi-patcher/
|
cd "${HOME}"/.patchimage/tools/wiimmfi-patcher/
|
||||||
|
|
||||||
if [[ ${ID} == ALL ]]; then
|
ln -s "${GAMEDIR}"/"${ID}" .
|
||||||
for image in ${IMAGE%/*}/RMC???.{iso,wbfs}; do
|
./patch-wiimmfi.sh >/dev/null || \
|
||||||
if [[ -e ${image} ]]; then
|
( echo "wiimmfi-ing the image failed." && exit 69 )
|
||||||
ln -s "${image}" .
|
mv -v ./wiimmfi-images/"${ID}" "${PATCHIMAGE_GAME_DIR}"/
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
./patch-wiimmfi.sh >/dev/null || \
|
rm -rf "${HOME}"/.patchimage/tools/wiimfi-patcher/
|
||||||
( echo "wiimmfi-ing the images failed." && exit 69 )
|
|
||||||
mv -v ./wiimmfi-images/* "${PATCHIMAGE_GAME_DIR}"/
|
|
||||||
|
|
||||||
else
|
|
||||||
if [[ ! -f ${IMAGE%/*}/${ID} ]]; then
|
|
||||||
echo "unvalid game passed from user-input. exit"
|
|
||||||
exit 75
|
|
||||||
fi
|
|
||||||
|
|
||||||
ln -s ${IMAGE%/*}/${ID} .
|
|
||||||
./patch-wiimmfi.sh >/dev/null || \
|
|
||||||
( echo "wiimmfi-ing the image failed." && exit 69 )
|
|
||||||
mv -v ./wiimmfi-images/${ID} "${PATCHIMAGE_GAME_DIR}"/
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf ${HOME}/.patchimage/tools/wiimfi-patcher/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pi_action () {
|
pi_action () {
|
||||||
|
Loading…
Reference in New Issue
Block a user