Ignore:
Timestamp:
02/27/17 22:24:39 (7 years ago)
Author:
obi
Message:

optimize

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/tithek/tithek_global.h

    r40161 r40174  
    836836                        {
    837837                                dnode->host = ostrcat("atemio.dyndns.tv", NULL, 0, 0);
    838                                 dnode->page = ostrcat("/mediathek/python.tar", NULL, 0, 0);
    839838                                dnode->port = 80;
    840                                 printf("getfreespace /mnt %d\n", getfreespace("/mnt") / 1024 < 102400);
    841                                 printf("getfreespace /media/hdd %d\n", getfreespace("/media/hdd") / 1024 < 102400);
    842                                 printf("getfreespace /var/swap %d\n", getfreespace("/var/swap") / 1024 < 102400);
    843                                 printf("getfreespace /tmp %d\n", getfreespace("/tmp") / 1024 < 102400);
    844 
    845                                 if(getfreespace("/mnt") / 1024 < 102400) //100mb
     839                                if(getfreespace("/mnt") / 1024 > 102400) //100mb
    846840                                {
    847841                                        mkdir("/mnt/.tithek", 0777);
    848842                                        if(file_exist("/mnt/.tithek"))
    849843                                                dnode->filename = ostrcat("/mnt/.tithek/python.tar", NULL, 0, 0);
    850                                 }                               
    851                                 else if(file_exist("/media/hdd") && getfreespace("/media/hdd") / 1024 < 102400)
     844                                        dnode->page = ostrcat("/mediathek/python_full.tar", NULL, 0, 0);                               
     845                                }
     846                                else if(file_exist("/media/hdd") && getfreespace("/media/hdd") / 1024 > 102400)
    852847                                {
    853848                                        mkdir("/media/hdd/.tithek", 0777);
    854849                                        if(file_exist("/media/hdd/.tithek"))
    855850                                                dnode->filename = ostrcat("/media/hdd/.tithek/python.tar", NULL, 0, 0);
     851                                        dnode->page = ostrcat("/mediathek/python_full.tar", NULL, 0, 0);                               
    856852                                }
    857                                 else if(file_exist("/var/swap") && getfreespace("/var/swap") / 1024 < 102400)
     853                                else if(file_exist("/var/swap") && getfreespace("/var/swap") / 1024 > 102400)
    858854                                {
    859855                                        mkdir("/var/swap/.tithek", 0777);
    860856                                        if(file_exist("/var/swap/.tithek"))
    861857                                                dnode->filename = ostrcat("/var/swap/.tithek/python.tar", NULL, 0, 0);
     858                                        dnode->page = ostrcat("/mediathek/python_full.tar", NULL, 0, 0);                               
     859                                }
     860                                else if(getfreespace("/tmp") / 1024 > 102400)
     861                                {
     862                                        dnode->filename = ostrcat("/tmp/python.tar", NULL, 0, 0);
     863                                        dnode->page = ostrcat("/mediathek/python_full.tar", NULL, 0, 0);                               
    862864                                }
    863865                                else
     866                                {
    864867                                        dnode->filename = ostrcat("/tmp/python.tar", NULL, 0, 0);
     868                                        dnode->page = ostrcat("/mediathek/python.tar", NULL, 0, 0);                             
     869                                }
     870
    865871                                dnode->auth = ostrcat(HTTPAUTH, NULL, 0, 0);
    866872                                dnode->connfd = -1;
Note: See TracChangeset for help on using the changeset viewer.