Changeset 13417


Ignore:
Timestamp:
12/09/09 02:05:34 (3 years ago)
Author:
BrainSlayer
Message:

modularisation

Location:
src/router/services/services
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • src/router/services/services/chillispot.c

    r13382 r13417  
    5151#ifdef HAVE_HOTSPOT 
    5252 
    53         if (nvram_match("chilli_enable", "1") && nvram_match("chilli_def_enable", "0") 
    54          && !nvram_match("hotss_enable", "1")) {                 
     53        if (nvram_match("chilli_enable", "1") 
     54            && nvram_match("chilli_def_enable", "0") 
     55            && !nvram_match("hotss_enable", "1")) { 
    5556                nvram_set("chilli_enable", "0"); 
    5657                return; 
    5758        } 
    5859 
    59         if (!nvram_match("chilli_enable", "1") && !nvram_match("hotss_enable", "1")) 
    60                 return; 
    61                  
     60        if (!nvram_match("chilli_enable", "1") 
     61            && !nvram_match("hotss_enable", "1")) 
     62                return; 
     63 
    6264        if (nvram_match("hotss_enable", "1")) { 
    63                 if(!nvram_match("chilli_enable", "1")) {                 
    64                         nvram_set("chilli_enable", "1");  // to get care of firewall, network, etc. 
     65                if (!nvram_match("chilli_enable", "1")) { 
     66                        nvram_set("chilli_enable", "1");        // to get care of firewall, network, etc. 
    6567                        nvram_set("chilli_def_enable", "0"); 
    6668                } 
    67                 hotspotsys_config();             
    68         } 
    69         else if (nvram_match("chilli_enable", "1")) { 
    70                 nvram_unset("chilli_def_enable");                
    71                 chilli_config();                 
    72         } 
    73                  
     69                hotspotsys_config(); 
     70        } else if (nvram_match("chilli_enable", "1")) { 
     71                nvram_unset("chilli_def_enable"); 
     72                chilli_config(); 
     73        } 
    7474#else 
    7575        if (!nvram_match("chilli_enable", "1")) 
    7676                return; 
    77                  
     77 
    7878        chilli_config(); 
    79          
     79 
    8080#endif 
    8181 
     
    105105        FILE *fp; 
    106106        int i; 
    107          
     107 
    108108#ifdef HAVE_CHILLILOCAL 
    109109 
     
    138138        fprintf(fp, "radiusserver2 %s\n", nvram_get("chilli_backup")); 
    139139        fprintf(fp, "radiussecret %s\n", nvram_get("chilli_pass")); 
    140          
     140 
    141141        if (nvram_match("chilli_nowifibridge", "1")) 
    142142                fprintf(fp, "dhcpif %s\n", nvram_safe_get("chilli_interface")); 
     
    214214        fflush(fp); 
    215215        fclose(fp); 
    216          
    217         return;  
     216 
     217        return; 
    218218} 
    219  
    220219 
    221220#ifdef HAVE_HOTSPOT 
     
    229228        int i; 
    230229 
    231  
    232230        if (!(fp = fopen("/tmp/chilli.conf", "w"))) { 
    233231                perror("/tmp/chilli.conf"); 
     
    238236        fprintf(fp, "radiusserver2 radius2.hotspotsystem.com\n"); 
    239237        fprintf(fp, "radiussecret hotsys123\n"); 
    240                  
     238 
    241239        if (nvram_match("hotss_nowifibridge", "1")) 
    242240                fprintf(fp, "dhcpif %s\n", nvram_safe_get("hotss_interface")); 
    243241        else 
    244242                fprintf(fp, "dhcpif br0\n"); 
    245                          
    246         fprintf(fp, "uamserver https://www.hotspotsystem.com/customer/hotspotlogin.php\n"); 
    247                  
     243 
     244        fprintf(fp, 
     245                "uamserver https://www.hotspotsystem.com/customer/hotspotlogin.php\n"); 
     246 
    248247        if (nvram_invmatch("wan_get_dns", "0.0.0.0") 
    249             && nvram_invmatch("wan_get_dns", "")) {                      
    250                         dnslist = nvram_safe_get ("wan_get_dns"); 
    251                         i = 1; 
    252                         foreach(var, dnslist, next) { 
    253                                 if (i > 2) break; 
    254                                 fprintf(fp, "dns%d %s\n", i, var); 
    255                                 i++; 
    256                         } 
    257         } 
    258         else if (nvram_invmatch("wan_dns", "0.0.0.0") 
    259                 && nvram_invmatch("wan_dns", "")) { 
    260                         dnslist = nvram_safe_get ("wan_dns"); 
    261                         i = 1; 
    262                         foreach(var, dnslist, next) { 
    263                                 if (i > 2) break; 
    264                                 fprintf(fp, "dns%d %s\n", i, var); 
    265                                 i++; 
    266                         } 
    267         } 
    268         else if (nvram_invmatch("sv_localdns", "0.0.0.0") 
    269                 && nvram_invmatch("sv_localdns", "")) { 
    270                         fprintf(fp, "dns1 %s\n", nvram_get("sv_localdns")); 
     248            && nvram_invmatch("wan_get_dns", "")) { 
     249                dnslist = nvram_safe_get("wan_get_dns"); 
     250                i = 1; 
     251                foreach(var, dnslist, next) { 
     252                        if (i > 2) 
     253                                break; 
     254                        fprintf(fp, "dns%d %s\n", i, var); 
     255                        i++; 
     256                } 
     257        } else if (nvram_invmatch("wan_dns", "0.0.0.0") 
     258                   && nvram_invmatch("wan_dns", "")) { 
     259                dnslist = nvram_safe_get("wan_dns"); 
     260                i = 1; 
     261                foreach(var, dnslist, next) { 
     262                        if (i > 2) 
     263                                break; 
     264                        fprintf(fp, "dns%d %s\n", i, var); 
     265                        i++; 
     266                } 
     267        } else if (nvram_invmatch("sv_localdns", "0.0.0.0") 
     268                   && nvram_invmatch("sv_localdns", "")) { 
     269                fprintf(fp, "dns1 %s\n", nvram_get("sv_localdns")); 
    271270        } 
    272271 
    273272        fprintf(fp, "uamsecret hotsys123\n"); 
    274273        fprintf(fp, "uamanydns\n"); 
    275                  
    276         if (nvram_invmatch("hotss_uamallowed", "") && nvram_match("hotss_uamenable", "1")) 
     274 
     275        if (nvram_invmatch("hotss_uamallowed", "") 
     276            && nvram_match("hotss_uamenable", "1")) 
    277277                fprintf(fp, "uamallowed %s\n", nvram_get("hotss_uamallowed")); 
    278278 
    279         fprintf(fp, "radiusnasid %s_%s\n", nvram_get("hotss_operatorid"), nvram_get("hotss_locationid")); 
    280                  
    281         fprintf(fp, "uamhomepage https://customer.hotspotsystem.com/customer/index.php?operator=%s&location=%s\n", nvram_get("hotss_operatorid"), nvram_get("hotss_locationid")); 
     279        fprintf(fp, "radiusnasid %s_%s\n", nvram_get("hotss_operatorid"), 
     280                nvram_get("hotss_locationid")); 
     281 
     282        fprintf(fp, 
     283                "uamhomepage https://customer.hotspotsystem.com/customer/index.php?operator=%s&location=%s\n", 
     284                nvram_get("hotss_operatorid"), nvram_get("hotss_locationid")); 
    282285        fprintf(fp, "coaport 3799\n"); 
    283286        fprintf(fp, "coanoipcheck\n"); 
    284287        fprintf(fp, "domain key.chillispot.info\n"); 
    285         fprintf(fp, "uamallowed hotspotsystem.com,customer.hotspotsystem.com\n"); 
    286         fprintf(fp, "uamallowed 194.149.46.0/24,198.241.128.0/17,66.211.128.0/17,216.113.128.0/17\n"); 
    287         fprintf(fp, "uamallowed 70.42.128.0/17,128.242.125.0/24,216.52.17.0/24\n"); 
    288         fprintf(fp, "uamallowed 62.249.232.74,155.136.68.77,155.136.66.34,66.4.128.0/17,66.211.128.0/17,66.235.128.0/17\n"); 
    289         fprintf(fp, "uamallowed 88.221.136.146,195.228.254.149,195.228.254.152,203.211.140.157,203.211.150.204\n"); 
     288        fprintf(fp, 
     289                "uamallowed hotspotsystem.com,customer.hotspotsystem.com\n"); 
     290        fprintf(fp, 
     291                "uamallowed 194.149.46.0/24,198.241.128.0/17,66.211.128.0/17,216.113.128.0/17\n"); 
     292        fprintf(fp, 
     293                "uamallowed 70.42.128.0/17,128.242.125.0/24,216.52.17.0/24\n"); 
     294        fprintf(fp, 
     295                "uamallowed 62.249.232.74,155.136.68.77,155.136.66.34,66.4.128.0/17,66.211.128.0/17,66.235.128.0/17\n"); 
     296        fprintf(fp, 
     297                "uamallowed 88.221.136.146,195.228.254.149,195.228.254.152,203.211.140.157,203.211.150.204\n"); 
    290298        fprintf(fp, "uamallowed www.paypal.com,www.paypalobjects.com\n"); 
    291         fprintf(fp, "uamallowed www.worldpay.com,select.worldpay.com,secure.ims.worldpay.com,www.rbsworldpay.com,secure.wp3.rbsworldpay.com\n"); 
    292         fprintf(fp, "uamallowed www.hotspotsystem.com,customer.hotspotsystem.com,tech.hotspotsystem.com\n"); 
    293         fprintf(fp, "uamallowed a1.hotspotsystem.com,a2.hotspotsystem.com,a3.hotspotsystem.com,a4.hotspotsystem.com,a5.hotspotsystem.com,a6.hotspotsystem.com\n"); 
    294         fprintf(fp, "uamallowed a7.hotspotsystem.com,a8.hotspotsystem.com,a9.hotspotsystem.com,a10.hotspotsystem.com\n"); 
     299        fprintf(fp, 
     300                "uamallowed www.worldpay.com,select.worldpay.com,secure.ims.worldpay.com,www.rbsworldpay.com,secure.wp3.rbsworldpay.com\n"); 
     301        fprintf(fp, 
     302                "uamallowed www.hotspotsystem.com,customer.hotspotsystem.com,tech.hotspotsystem.com\n"); 
     303        fprintf(fp, 
     304                "uamallowed a1.hotspotsystem.com,a2.hotspotsystem.com,a3.hotspotsystem.com,a4.hotspotsystem.com,a5.hotspotsystem.com,a6.hotspotsystem.com\n"); 
     305        fprintf(fp, 
     306                "uamallowed a7.hotspotsystem.com,a8.hotspotsystem.com,a9.hotspotsystem.com,a10.hotspotsystem.com\n"); 
    295307 
    296308        fprintf(fp, "interval 300\n"); 
     
    302314} 
    303315 
    304  
    305316#endif                          /* HAVE_HOTSPOT */ 
    306317#endif                          /* HAVE_CHILLI */ 
  • src/router/services/services/cron.c

    r13414 r13417  
    5454#include <syslog.h> 
    5555#include <services.h> 
    56  
    5756 
    5857void start_cron(void) 
  • src/router/services/services/l2tp.c

    r13414 r13417  
    5454#include <syslog.h> 
    5555#include <services.h> 
    56  
    5756 
    5857#ifdef HAVE_L2TP 
  • src/router/services/services/mmc.c

    r13233 r13417  
    9595                sprintf(ddclk, "DDCLK=0x%X", 1 << mmc_clk); 
    9696                sprintf(ddcs, "DDCS=0x%X", 1 << mmc_cs); 
    97 */               
     97*/ 
    9898                sprintf(dddi, "din=%d", mmc_di); 
    9999                sprintf(dddo, "dout=%d", mmc_do); 
  • src/router/services/services/pppoe.c

    r13414 r13417  
    6060#define sin_addr(s) (((struct sockaddr_in *)(s))->sin_addr) 
    6161 
    62  
    6362// =========================================tallest============================================ 
    6463/* 
     
    142141        return; 
    143142} 
    144  
    145143 
    146144void start_pppoe(int pppoe_num) 
     
    265263        return; 
    266264} 
     265 
    267266void stop_pppoe(void) 
    268267{ 
     
    307306} 
    308307 
    309  
    310308#endif 
    311  
  • src/router/services/services/pptpclient.c

    r13414 r13417  
    5454#include <syslog.h> 
    5555#include <services.h> 
    56  
    57  
    5856 
    5957#ifdef HAVE_PPTP 
     
    293291 
    294292#endif 
    295  
  • src/router/services/services/services.c

    r13414 r13417  
    6060#define TXPWR_DEFAULT 70 
    6161 
    62  
    63  
    64  
    6562static int alreadyInHost(char *host) 
    6663{ 
     
    106103} 
    107104 
    108  
    109105/* 
    110106 * AhMan March 18 2005  
     
    239235} 
    240236 
    241  
    242  
    243  
    244237#ifdef HAVE_IPV6 
    245238void start_ipv6(void) 
     
    284277 
    285278// ===================================================================================================== 
    286  
    287279 
    288280void stop_wland(void) 
     
    458450        return; 
    459451} 
    460  
    461 #ifdef HAVE_CPUTEMP 
    462  
    463 #ifdef HAVE_GATEWORX 
    464 #define TEMP_PATH "/sys/devices/platform/IXP4XX-I2C.0/i2c-adapter:i2c-0/0-0028" 
    465 // #define TEMP_PATH "/sys/devices/platform/IXP4XX-I2C.0/i2c-0/0-0028" 
    466 #define TEMP_PREFIX "temp" 
    467 #define TEMP_MUL 100 
    468 #else 
    469 #ifdef HAVE_X86 
    470 #define TEMP_PATH "/sys/devices/platform/i2c-1/1-0048" 
    471 #else 
    472 #define TEMP_PATH "/sys/devices/platform/i2c-0/0-0048" 
    473 #endif 
    474 #define TEMP_PREFIX "temp1" 
    475 #define TEMP_MUL 1000 
    476 #endif 
    477  
    478 void start_hwmon(void) 
    479 { 
    480         int temp_max = atoi(nvram_safe_get("hwmon_temp_max")) * TEMP_MUL; 
    481         int temp_hyst = atoi(nvram_safe_get("hwmon_temp_hyst")) * TEMP_MUL; 
    482  
    483         sysprintf("/bin/echo %d > %s/%s_max", temp_max, TEMP_PATH, TEMP_PREFIX); 
    484         sysprintf("/bin/echo %d > %s/%s_max_hyst", temp_hyst, TEMP_PATH, 
    485                   TEMP_PREFIX); 
    486         dd_syslog(LOG_INFO, "hwmon successfully started\n"); 
    487 } 
    488  
    489 #endif 
  • src/router/services/services/syslog.c

    r13414 r13417  
    5555#include <services.h> 
    5656 
    57  
    5857#ifdef HAVE_SYSLOG 
    5958void start_syslog(void) 
  • src/router/services/services/usb_hotplug.c

    r13304 r13417  
    3030        int class, subclass, protocol; 
    3131 
    32  
    3332        if (!(nvram_match("usb_automnt", "1"))) 
    3433                return; 
    35  
    3634 
    3735        if (!(action = getenv("ACTION")) || !(device = getenv("TYPE"))) 
     
    4543                sscanf(interface, "%d/%d/%d", &class, &subclass, &protocol); 
    4644        } 
    47  
    4845 
    4946        /*  
     
    131128        int i, found = 0; 
    132129 
    133         for (i = 1; i < 16; i++ ) {  //it needs some time for disk to settle down and /dev/discs is created 
     130        for (i = 1; i < 16; i++) {      //it needs some time for disk to settle down and /dev/discs is created 
    134131                if ((dir = opendir("/dev/discs")) != NULL) { 
    135132                        break; 
    136                 } 
    137                 else { 
    138                         sleep (1); 
    139                 } 
    140         } 
    141                 if (i == 15) 
    142                         return EINVAL; 
     133                } else { 
     134                        sleep(1); 
     135                } 
     136        } 
     137        if (i == 15) 
     138                return EINVAL; 
    143139 
    144140        /*  
     
    146142         */ 
    147143 
    148         for (i = 1; i < 16; i++ ) {  //it needs some time for disk to settle down and /dev/discs/discs%d is created 
     144        for (i = 1; i < 16; i++) {      //it needs some time for disk to settle down and /dev/discs/discs%d is created 
    149145                while ((entry = readdir(dir)) != NULL) { 
    150146                        if ((strncmp(entry->d_name, "disc", 4))) 
     
    153149                                found = 1; 
    154150 
    155                 /*  
    156                 * Files created when the UFD is inserted are not removed when 
    157                 * it is removed. Verify the device  is still inserted.  Strip 
    158                 * the "disc" and pass the rest of the string.   
    159                 */ 
    160  
    161                 if (usb_ufd_connected(entry->d_name + 4) == FALSE) 
    162                         continue; 
    163  
    164                 sprintf(path, "/dev/discs/%s/disc", entry->d_name); 
    165  
    166                 sysprintf("/usr/sbin/disktype %s > %s", path, DUMPFILE); 
    167  
    168                 /*  
    169                 * Check if it has file system  
    170                 */ 
    171                 if ((fp = fopen(DUMPFILE, "r"))) { 
    172                         while (fgets(line, sizeof(line), fp) != NULL) { 
    173                                 if (strstr(line, "Partition")) 
    174                                         is_part = 1; 
    175  
    176                                 if (strstr(line, "file system")) { 
    177                                         if (strstr(line, "FAT")) { 
    178                                                 fs = "vfat"; 
    179                                                 break; 
    180                                         } else if (strstr(line, "Ext2")) { 
    181                                                 fs = "ext2"; 
    182                                                 break; 
    183                                         } else if (strstr(line, "Ext3")) { 
     151                        /*  
     152                        * Files created when the UFD is inserted are not removed when 
     153                        * it is removed. Verify the device  is still inserted.  Strip 
     154                        * the "disc" and pass the rest of the string.   
     155                        */ 
     156 
     157                        if (usb_ufd_connected(entry->d_name + 4) == FALSE) 
     158                                continue; 
     159 
     160                        sprintf(path, "/dev/discs/%s/disc", entry->d_name); 
     161 
     162                        sysprintf("/usr/sbin/disktype %s > %s", path, DUMPFILE); 
     163 
     164                        /*  
     165                        * Check if it has file system  
     166                        */ 
     167                        if ((fp = fopen(DUMPFILE, "r"))) { 
     168                                while (fgets(line, sizeof(line), fp) != NULL) { 
     169                                        if (strstr(line, "Partition")) 
     170                                                is_part = 1; 
     171 
     172                                        if (strstr(line, "file system")) { 
     173                                                if (strstr(line, "FAT")) { 
     174                                                        fs = "vfat"; 
     175                                                        break; 
     176                                                } else if (strstr(line, "Ext2")) { 
     177                                                        fs = "ext2"; 
     178                                                        break; 
     179                                                } else if (strstr(line, "Ext3")) { 
    184180#ifdef HAVE_USB_ADVANCED 
    185                                                 fs = "ext3"; 
     181                                                        fs = "ext3"; 
    186182#else 
    187                                                 fs = "ext2"; 
     183                                                        fs = "ext2"; 
    188184#endif 
    189                                                 break; 
     185                                                        break; 
     186                                                } 
    190187                                        } 
     188 
    191189                                } 
    192  
    193                         } 
    194                         fclose(fp); 
    195                 } 
    196  
    197                 if (fs) { 
    198                         /*  
    199                          * If it is partioned, mount first partition else raw disk  
    200                          */ 
    201                         if (is_part) { 
    202                                 partitions = 
    203                                     "part1 part2 part3 part4 part5 part6"; 
    204                                 foreach(part, partitions, next) { 
    205                                         sprintf(path, "/dev/discs/%s/%s", 
    206                                                 entry->d_name, part); 
    207                                         if (stat(path, &tmp_stat)) 
    208                                                 continue; 
    209                                         if (usb_process_path(path, fs) == 0) { 
     190                                fclose(fp); 
     191                        } 
     192 
     193                        if (fs) { 
     194                                /*  
     195                                 * If it is partioned, mount first partition else raw disk  
     196                                 */ 
     197                                if (is_part) { 
     198                                        partitions = 
     199                                            "part1 part2 part3 part4 part5 part6"; 
     200                                        foreach(part, partitions, next) { 
     201                                                sprintf(path, 
     202                                                        "/dev/discs/%s/%s", 
     203                                                        entry->d_name, part); 
     204                                                if (stat(path, &tmp_stat)) 
     205                                                        continue; 
     206                                                if (usb_process_path(path, fs) 
     207                                                    == 0) { 
     208                                                        is_mounted = 1; 
     209                                                        break; 
     210                                                } 
     211                                        } 
     212                                } else { 
     213                                        if (usb_process_path(path, fs) == 0) 
    210214                                                is_mounted = 1; 
    211                                                 break; 
    212                                         } 
    213215                                } 
    214                         } else { 
    215                                 if (usb_process_path(path, fs) == 0) 
    216                                         is_mounted = 1; 
    217                         } 
    218  
    219                 } 
    220  
    221                 if ((fp = fopen(DUMPFILE, "a"))) { 
    222                         if (fs && is_mounted) 
    223                                 fprintf(fp, "Status: <b>Mounted on /%s</b>\n", 
    224                                         nvram_safe_get("usb_mntpoint")); 
    225                         else if (fs) 
    226                                 fprintf(fp, "Status: <b>Not mounted</b>\n"); 
    227                         else 
    228                                 fprintf(fp, 
    229                                         "Status: <b>Not mounted - Unsupported file system or disk not formated</b>\n"); 
    230                         fclose(fp); 
    231                 } 
    232  
    233                 if (is_mounted && !nvram_match("usb_runonmount", "")) { 
    234                         sprintf(path, "%s", nvram_safe_get("usb_runonmount")); 
    235                         if (stat(path, &tmp_stat) == 0) //file exists 
    236                         { 
    237                                 setenv("PATH", 
    238                                        "/sbin:/bin:/usr/sbin:/usr/bin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin", 
    239                                        1); 
    240                                 setenv("LD_LIBRARY_PATH", 
    241                                        "/lib:/usr/lib:/jffs/lib:/jffs/usr/lib:/mmc/lib:/mmc/usr/lib:/opt/lib:/opt/usr/lib", 
    242                                        1); 
    243                          
    244                                         system(path); 
    245                         } 
    246                 } 
    247  
    248                 if (is_mounted) { //temp. fix: only mount 1st mountable part, then exit 
    249                         closedir (dir); 
    250                         return 0; 
    251                         } 
    252         } 
    253         if (!found) 
    254                 sleep (1); 
    255         else 
    256                 break; 
    257         } 
    258         closedir (dir); 
     216 
     217                        } 
     218 
     219                        if ((fp = fopen(DUMPFILE, "a"))) { 
     220                                if (fs && is_mounted) 
     221                                        fprintf(fp, 
     222                                                "Status: <b>Mounted on /%s</b>\n", 
     223                                                nvram_safe_get("usb_mntpoint")); 
     224                                else if (fs) 
     225                                        fprintf(fp, 
     226                                                "Status: <b>Not mounted</b>\n"); 
     227                                else 
     228                                        fprintf(fp, 
     229                                                "Status: <b>Not mounted - Unsupported file system or disk not formated</b>\n"); 
     230                                fclose(fp); 
     231                        } 
     232 
     233                        if (is_mounted && !nvram_match("usb_runonmount", "")) { 
     234                                sprintf(path, "%s", 
     235                                        nvram_safe_get("usb_runonmount")); 
     236                                if (stat(path, &tmp_stat) == 0) //file exists 
     237                                { 
     238                                        setenv("PATH", 
     239                                               "/sbin:/bin:/usr/sbin:/usr/bin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin", 
     240                                               1); 
     241                                        setenv("LD_LIBRARY_PATH", 
     242                                               "/lib:/usr/lib:/jffs/lib:/jffs/usr/lib:/mmc/lib:/mmc/usr/lib:/opt/lib:/opt/usr/lib", 
     243                                               1); 
     244 
     245                                        system(path); 
     246                                } 
     247                        } 
     248 
     249                        if (is_mounted) {       //temp. fix: only mount 1st mountable part, then exit 
     250                                closedir(dir); 
     251                                return 0; 
     252                        } 
     253                } 
     254                if (!found) 
     255                        sleep(1); 
     256                else 
     257                        break; 
     258        } 
     259        closedir(dir); 
    259260        return 0; 
    260261} 
  • src/router/services/services/vpn.c

    r13414 r13417  
    5454#include <syslog.h> 
    5555#include <services.h> 
    56  
    5756 
    5857void start_vpn_modules(void) 
     
    117116#endif 
    118117} 
    119  
  • src/router/services/services/wifidog.c

    r13133 r13417  
    6262                fprintf(fp, "HTTPPort %s\n", nvram_safe_get("wd_httpport")); 
    6363                if (strlen(nvram_safe_get("wd_messagefile")) > 0) { 
    64                         fprintf(fp, "HtmlMessageFile %s\n", nvram_safe_get("wd_messagefile")); 
     64                        fprintf(fp, "HtmlMessageFile %s\n", 
     65                                nvram_safe_get("wd_messagefile")); 
    6566                } 
    66                 if (nvram_match("wd_auth","1")) 
    67                     { 
    68                         if (strlen(nvram_safe_get("wd_realm")) > 0)  
    69                         fprintf(fp, "HTTPDRealm %s\n", nvram_safe_get("wd_realm")); 
    70                         fprintf(fp, "HTTPDUserName %s\n", nvram_safe_get("wd_username")); 
    71                         fprintf(fp, "HTTPDPassword %s\n", nvram_safe_get("wd_password")); 
    72                     } 
     67                if (nvram_match("wd_auth", "1")) { 
     68                        if (strlen(nvram_safe_get("wd_realm")) > 0) 
     69                                fprintf(fp, "HTTPDRealm %s\n", 
     70                                        nvram_safe_get("wd_realm")); 
     71                        fprintf(fp, "HTTPDUserName %s\n", 
     72                                nvram_safe_get("wd_username")); 
     73                        fprintf(fp, "HTTPDPassword %s\n", 
     74                                nvram_safe_get("wd_password")); 
     75                } 
    7376                fprintf(fp, "Path %s\n", nvram_safe_get("wd_path")); 
    7477                fprintf(fp, "}\n"); 
Note: See TracChangeset for help on using the changeset viewer.