Changeset 32986


Ignore:
Timestamp:
02/14/15 21:09:20 (8 years ago)
Author:
obi
Message:

add updater

Location:
titan
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • titan/skins/readerconfig/skin.xml

    r32982 r32986  
    1414                <node parent="buttonbar" name="b1" picmem="skin/key_red_30x30.png"    textposx="40" valign="middle" posx="220" posy="center" width="200" height="30" text="EDIT">
    1515                <node parent="buttonbar" name="b2" picmem="skin/key_green_30x30.png"  textposx="40" valign="middle" posx="430" posy="center" width="270" height="30" text="Dvbapi">
    16                 <node parent="buttonbar" name="b3" picmem="skin/key_yellow_30x30.png"  textposx="40" valign="middle" posx="710" posy="center" width="200" height="30" text="Key-Update">
    1716</screen>
    1817
  • titan/titan/softcam.h

    r32524 r32986  
    410410                                textbox(_("Message"), _("Reader Config Plugin not installed !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 10, 0);
    411411                }
     412                if(rcret == getrcconfigint("rcinfo", NULL))
     413                {
     414                        char* extract = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *tmpstr3 = NULL;
     415
     416                        tmpstr = ostrcat(listbox->select->name, NULL, 0, 0);
     417                        string_tolower(tmpstr);
     418                       
     419                        if(listbox->select->name == NULL)
     420                        {
     421                                tmpstr1 = getoscamconfig();     
     422                                if(tmpstr1 == NULL) return;
     423                                extract = ostrcat("tar -zxvf /tmp/.tmp.tar.gz -C ", tmpstr1, 0, 0);
     424                                extract = ostrcat(extract, "/keys/", 1, 0);
     425                                free(tmpstr1), tmpstr1 = NULL;
     426                        }
     427                        else
     428                        {
     429                                cmd = ostrcat("/sbin/emu.sh keydir ", listbox->select->name, 0, 0);
     430                                tmpstr1 = string_newline(command(cmd));
     431                                extract = ostrcat("tar -zxvf /tmp/.tmp.tar.gz -C ", tmpstr1, 0, 0);
     432                                extract = ostrcat(extract, "/", 1, 0);
     433                                free(cmd), cmd = NULL;
     434                                free(tmpstr1), tmpstr1 = NULL;
     435                        }
     436
     437                        tmpstr1 = ostrcat("/autokeys/", tmpstr, 0, 0);
     438                        tmpstr1 = ostrcat(tmpstr1, ".tar.gz", 0, 0);
     439
     440                        tmpstr2 = ostrcat(listbox->select->name, " ", 0, 0);
     441                        tmpstr2 = ostrcat(tmpstr2, _("Keys Updatet !"), 1, 0);
     442
     443                        tmpstr3 = ostrcat(_("Restart"), " ", 0, 0);
     444                        tmpstr3 = ostrcat(tmpstr3, listbox->select->name, 1, 0);
     445                        tmpstr3 = ostrcat(tmpstr3, " ?", 1, 0);
     446
     447                        int ret = 1;
     448
     449                        gethttp("atemio.dyndns.tv", tmpstr1, 80, "/tmp/.tmp.tar.gz", HTTPAUTH, 5000, NULL, 0);         
     450
     451                        printf("extract: %s\n", extract);
     452                        system(extract);
     453
     454                        if(ret == 0)
     455                        {
     456                                textbox(_("Message"), tmpstr2, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 10, 0);
     457                                if(textbox(_("Message"), tmpstr3, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0) == 1)
     458                                {
     459                                        cmd = ostrcat("emu.sh restart" , NULL, 0, 0);
     460                                        ret = system(cmd);
     461                                        free(cmd);
     462                                }
     463                        }
     464                        system("rm -rf /tmp/.tmp.tar.gz");
     465
     466                        free(tmpstr); tmpstr = NULL;
     467                        free(tmpstr1); tmpstr1 = NULL;
     468                        free(tmpstr2); tmpstr2 = NULL;
     469                        free(tmpstr3); tmpstr3 = NULL;
     470                        free(extract); extract = NULL;
     471                }
    412472                if(rcret == RCTIMEOUT)
    413473                {
Note: See TracChangeset for help on using the changeset viewer.