Changeset 35876 for titan/plugins


Ignore:
Timestamp:
10/07/15 19:48:26 (9 years ago)
Author:
gost
Message:

[ip-cam] add alternate webif step1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/instar/instar.h

    r35872 r35876  
    5050                                else
    5151                                        tmpstr = ostrcat(cam1, "/snapshot.cgi", 0, 0);
     52                                if(getconfigint("instar_alterwebif", NULL) == 1)
     53                                        tmpstr = ostrcat(cam1, " > /tmp/instar1.jpg", 0, 0);
    5254                                system(tmpstr);
    5355                                free(tmpstr); tmpstr = NULL;
     
    6365                                else
    6466                                        tmpstr = ostrcat(cam2, "/snapshot.cgi", 0, 0);
     67                                if(getconfigint("instar_alterwebif", NULL) == 1)
     68                                        tmpstr = ostrcat(cam2, " > /tmp/instar2.jpg", 0, 0);
    6569                                system(tmpstr);
    6670                                free(tmpstr); tmpstr = NULL;
     
    200204        struct skin* instar_einstellungen = getscreen("instar_einstellungen");
    201205        struct skin* listbox = getscreennode(instar_einstellungen, "listbox");
     206        struct skin* alterwebif = getscreennode(instar_einstellungen, "alterwebif");
    202207        struct skin* autoCam = getscreennode(instar_einstellungen, "autoCam");
    203208        struct skin* onCam1 = getscreennode(instar_einstellungen, "onCam1");
     
    219224        addchoicebox(autoCam, "ja", _("ja"));
    220225        setchoiceboxselection(autoCam, getlist(myconfig, "InstarCamAutostart", NULL));
     226       
     227        addchoicebox(alterwebif, "0", "off");
     228        addchoicebox(alterwebif, "1", "on");
     229        setchoiceboxselection(alterwebif, getconfig("instar_alterwebif", NULL));
    221230 
    222231  addchoicebox(onCam1, "aus", _("aus"));
     
    281290                        addconfig("instar_1", typCam1->ret);
    282291                        addconfig("instar_2", typCam2->ret);
     292                        addconfig("instar_alterwebif", alterwebif->ret);
    283293                        if(rcret == getrcconfigint("rcblue", NULL))
    284294                        {
     
    298308{
    299309        int rcode = 0;
    300 
     310       
    301311        instarconf = createpluginpath("/instar/instar.conf", 0);
    302312        readconfig(instarconf, myconfig);
     313
     314        char* CURL = NULL;
     315        CURL = createpluginpath("/instar/curl", 0);
    303316       
    304317  if(ostrcmp(getlist(myconfig, "InstarCamAutostart", NULL), "ja") == 0)
     
    315328                        if(ostrcmp(getlist(myconfig, "InstarCam1", NULL), "ein") == 0)
    316329                        {
    317                                 cam1 = ostrcat("wget --output-document=/tmp/instar1.jpg http://", getlist(myconfig, "InstarCam1User", NULL), 0, 0);
     330                                if(getconfigint("instar_alterwebif", NULL) == 0)
     331                                        cam1 = ostrcat("wget --output-document=/tmp/instar1.jpg http://", getlist(myconfig, "InstarCam1User", NULL), 0, 0);
     332                                else
     333                                {
     334                                        cam1 = ostrcat(CURL, " http://", 0, 0);
     335                                        cam1 = ostrcat(cam1, getlist(myconfig, "InstarCam1User", NULL), 1, 0);
     336                                }
    318337                                cam1 = ostrcat(cam1, ":",1, 0);
    319338                                cam1 = ostrcat(cam1, getlist(myconfig, "InstarCam1Pass", NULL), 1, 0);
     
    340359                        if(ostrcmp(getlist(myconfig, "InstarCam2", NULL), "ein") == 0)
    341360                        {
    342                                 cam2 = ostrcat("wget --output-document=/tmp/instar2.jpg http://", getlist(myconfig, "InstarCam2User", NULL), 0, 0);
     361                                if(getconfigint("instar_alterwebif", NULL) == 0)
     362                                        cam2 = ostrcat("wget --output-document=/tmp/instar2.jpg http://", getlist(myconfig, "InstarCam2User", NULL), 0, 0);
     363                                else
     364                                {
     365                                        cam2 = ostrcat(CURL, " http://", 0, 0);
     366                                        cam2 = ostrcat(cam1, getlist(myconfig, "InstarCam2User", NULL), 1, 0);
     367                                }
    343368                                cam2 = ostrcat(cam2, ":",1, 0);
    344369                                cam2 = ostrcat(cam2, getlist(myconfig, "InstarCam2Pass", NULL), 1, 0);
     
    387412        freelist(myconfig);
    388413        free(instarconf); instarconf = NULL;
     414        free(CURL); CURL = NULL;
    389415}
Note: See TracChangeset for help on using the changeset viewer.