From 9b335f1da8ec303d76bcdf5aa5f230b65950e325 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 16 Jul 2012 15:57:29 +0200 Subject: add --no-action parameter to exit after device detection --- src/idevicerestore.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/idevicerestore.c') diff --git a/src/idevicerestore.c b/src/idevicerestore.c index 36822a9..b77754b 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -57,6 +57,7 @@ static struct option longopts[] = { { "exclude", no_argument, NULL, 'x' }, { "shsh", no_argument, NULL, 't' }, { "pwn", no_argument, NULL, 'p' }, + { "no-action", no_argument, NULL, 'n' }, { NULL, 0, NULL, 0 } }; @@ -80,6 +81,8 @@ void usage(int argc, char* argv[]) { printf(" -x|--exclude exclude nor/baseband upgrade\n"); printf(" -t|--shsh fetch TSS record and save to .shsh file, then exit\n"); printf(" -p|--pwn Put device in pwned DFU mode and exit (limera1n devices only)\n"); + printf(" -n|--no-action Do not perform any restore action. If combined with -l option\n"); + printf(" the on demand ipsw download is performed before exiting.\n"); printf("\n"); } @@ -298,7 +301,7 @@ int main(int argc, char* argv[]) { } memset(client, '\0', sizeof(struct idevicerestore_client_t)); - while ((opt = getopt_long(argc, argv, "dhcesxtpli:u:", longopts, &optindex)) > 0) { + while ((opt = getopt_long(argc, argv, "dhcesxtpli:u:n", longopts, &optindex)) > 0) { switch (opt) { case 'h': usage(argc, argv); @@ -355,6 +358,10 @@ int main(int argc, char* argv[]) { client->flags |= FLAG_PWN; break; + case 'n': + client->flags |= FLAG_NOACTION; + break; + default: usage(argc, argv); return -1; @@ -556,6 +563,10 @@ int main(int argc, char* argv[]) { } } + if (client->flags & FLAG_NOACTION) { + return 0; + } + if (client->mode->index == MODE_RESTORE) { if (restore_reboot(client) < 0) { error("ERROR: Unable to exit restore mode\n"); -- cgit v1.1-32-gdbae