fixed the "only wait for nonce" option

This commit is contained in:
tihmstar 2017-01-02 00:29:18 +01:00
parent fc7aca91ec
commit dafb02dbdf

View file

@ -127,6 +127,8 @@ int main(int argc, const char * argv[]) {
argv += optind; argv += optind;
ipsw = argv[0]; ipsw = argv[0];
}else if (argc == optind && flags & FLAG_WAIT) {
info("User requested to only wait for APNonce to match, but not actually restoring\n");
}else{ }else{
error("argument parsing failed! agrc=%d optind=%d\n",argc,optind); error("argument parsing failed! agrc=%d optind=%d\n",argc,optind);
if (idevicerestore_debug){ if (idevicerestore_debug){
@ -204,18 +206,20 @@ int main(int argc, const char * argv[]) {
goto error; goto error;
} }
try { if (ipsw) {
res = client.doRestore(ipsw, flags & FLAG_UPDATE); try {
} catch (int error) { res = client.doRestore(ipsw, flags & FLAG_UPDATE);
if (error == -20) error("maybe you forgot -w ?\n"); } catch (int error) {
err = error; if (error == -20) error("maybe you forgot -w ?\n");
err = error;
}
cout << "Done: restoring "<< (!res ? "succeeded" : "failed")<<"." <<endl;
}else if (flags & FLAG_WAIT){
cout << "Done"<<endl;
} }
cout << "Done: restoring "<< (!res ? "succeeded" : "failed");
if (res) cout << ". Errorcode="<<err;
cout<<endl;
error: error:
if (res) cout << "Failed with errorcode="<<err << endl;
return err; return err;
#undef reterror #undef reterror
} }