#!/usr/bin/bash ############################################################################### # # Copyright (C) 2009-2013 Nintendo. All rights reserved. # # These coded instructions, statements, and computer programs contain # proprietary information of Nintendo of America Inc. and/or Nintendo # Company Ltd., and are protected by Federal copyright law. They may # not be disclosed to third parties or copied or duplicated in any form, # in whole or in part, without the prior written consent of Nintendo. # ############################################################################### source $(dirname "$0")/xmain.sh #============================== #UNINSTALL TITLE #This script uninstalls a title #from either USB or MLC # #VERSION 1.9 #============================== displayHelp(){ echo 'Debug RPX Script Required Options: -t : Title ID to uninstall Optional Options: -n : Title is on NAND (default: USB) -d : Dev number --help -h --h -help : Display help Example: '$(basename "$0")' -t 5000011000000' exit $1 } if [ $# == 0 ];then displayHelp 1 fi #get flags needed _initFlags #read user input tmp=("$@") for((i=0;i<$#;++i));do case "${tmp[i]}" in #obtain Title ID -t)if [ $((++i)) -ge $# ];then break fi TID="${tmp[i]}" verifyTID;; #obtain dev number -d)if [ $((++i)) -ge $# ];then break fi DEV="${tmp[i]}" #verify DEV ID input let DEV=DEV if `not_numeric "$DEV"`;then die Device number has to be numeric fi if [[ $? != 0 && "$DEV" != 0 ]];then exit 1 fi if [[ "$DEV" -le 0 || "$DEV" -gt 128 ]];then die Device number must be 1 - 128 fi;; #uninstall title on NAND -n)FLG=$((FLG|TITLE_MLC));; #display help and exit -h|--h|-help|--help) displayHelp 0;; esac done i= if [ -z "$TID" ];then die You must specify a title id to uninstall fi #make sure DEV ID is at least 2 characters if [ -z "$DEV" ];then DEV=01 else if [ "$DEV" -le 9 ];then DEV=0"$DEV" fi #only 1 MLC volume if [[ "$DEV" != 01 && $((FLG&TITLE_MLC)) != 0 ]];then die You cannot specify a device number for MLC fi fi #pad TID padTID echo -ne Writing custom devmenu scripts... #make a custom script openSCP #usb or mlc? if [ $((FLG&TITLE_MLC)) == 0 ];then i=usb else i=mlc fi #write custom script writeSCP "uninstall /vol/storage_$i$DEV/usr/title/${TID:0:8}/${TID:8}" echo done! echo Running devmenu... #execute and close custom script runSCP echo ' 'done!