Changeset 7416 for src/router/rc/services.c
- Timestamp:
- 07/09/07 21:27:18 (6 years ago)
- File:
-
- 1 edited
-
src/router/rc/services.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/router/rc/services.c
r7415 r7416 68 68 if (!metric || !ifname) 69 69 continue; 70 71 if (!strcmp (ipaddr,"0.0.0.0"))72 eval("route","del","default","gw",gateway);70 71 if (!strcmp (ipaddr, "0.0.0.0")) 72 eval ("route", "del", "default", "gw", gateway); 73 73 74 74 route_del (ifname, atoi (metric) + 1, ipaddr, gateway, netmask); … … 82 82 { 83 83 void *handle = NULL; 84 nvram_set ("qos_done","0");84 nvram_set ("qos_done", "0"); 85 85 #ifdef HAVE_CPUTEMP 86 86 handle = start_service_nofree ("hwmon", handle); … … 160 160 #endif 161 161 #ifdef HAVE_MILKFISH 162 handle = start_service_nofree ("milkfish", handle); 162 handle = start_service_nofree ("milkfish", handle); 163 163 #endif 164 164 dlclose (handle); … … 267 267 char service[80]; 268 268 char *services = nvram_safe_get ("action_service"); 269 sleep (3);269 sleep (3); 270 270 start_service ("overclocking"); 271 271 foreach (service, services, next) 272 272 { 273 fprintf (stderr, "Action %s\n", service);274 cprintf ("Restart service=[%s]\n", service);275 276 if (!strcmp (service, "dhcp"))277 {278 startstop ("udhcpd");279 }280 else if (!strcmp (service, "index"))281 {282 unlink ("/tmp/ppp/log");283 #ifndef HAVE_MADWIFI 284 stop_service ("nas");273 fprintf (stderr, "Action %s\n", service); 274 cprintf ("Restart service=[%s]\n", service); 275 276 if (!strcmp (service, "dhcp")) 277 { 278 startstop ("udhcpd"); 279 } 280 else if (!strcmp (service, "index")) 281 { 282 unlink ("/tmp/ppp/log"); 283 #ifndef HAVE_MADWIFI 284 stop_service ("nas"); 285 285 #endif 286 286 #ifdef HAVE_MADWIFI 287 stop_service ("stabridge");288 #endif 289 #ifdef HAVE_VLANTAGGING 290 stop_service ("bridgesif");291 stop_service ("vlantagging");287 stop_service ("stabridge"); 288 #endif 289 #ifdef HAVE_VLANTAGGING 290 stop_service ("bridgesif"); 291 stop_service ("vlantagging"); 292 292 #endif 293 293 #ifdef HAVE_BONDING 294 stop_service ("bonding");295 #endif 296 stop_service ("lan");297 #ifdef HAVE_VLANTAGGING 298 stop_service ("bridging");299 #endif 300 stop_service ("wan");301 #ifdef HAVE_VLANTAGGING 302 start_service ("bridging");303 #endif 304 start_service ("lan");294 stop_service ("bonding"); 295 #endif 296 stop_service ("lan"); 297 #ifdef HAVE_VLANTAGGING 298 stop_service ("bridging"); 299 #endif 300 stop_service ("wan"); 301 #ifdef HAVE_VLANTAGGING 302 start_service ("bridging"); 303 #endif 304 start_service ("lan"); 305 305 #ifdef HAVE_BONDING 306 start_service ("bonding");307 #endif 308 #ifdef HAVE_VLANTAGGING 309 start_service ("vlantagging");310 start_service ("bridgesif");311 #endif 312 start_service ("wan_boot");306 start_service ("bonding"); 307 #endif 308 #ifdef HAVE_VLANTAGGING 309 start_service ("vlantagging"); 310 start_service ("bridgesif"); 311 #endif 312 start_service ("wan_boot"); 313 313 #ifdef HAVE_MADWIFI 314 start_service ("stabridge");315 #endif 316 startstop ("udhcpd");317 startstop ("dnsmasq");318 #ifndef HAVE_MADWIFI 319 start_service ("nas");314 start_service ("stabridge"); 315 #endif 316 startstop ("udhcpd"); 317 startstop ("dnsmasq"); 318 #ifndef HAVE_MADWIFI 319 start_service ("nas"); 320 320 #ifdef HAVE_MSSID 321 start_service ("guest_nas");321 start_service ("guest_nas"); 322 322 #endif 323 323 #endif 324 324 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 325 startstop ("zebra");325 startstop ("zebra"); 326 326 #endif 327 327 #ifdef HAVE_OLSRD 328 startstop ("olsrd");329 #endif 330 startstop ("firewall");331 startstop ("httpd"); //httpd will not accept connection anymore on wan/lan ip changes changes332 }328 startstop ("olsrd"); 329 #endif 330 startstop ("firewall"); 331 startstop ("httpd"); //httpd will not accept connection anymore on wan/lan ip changes changes 332 } 333 333 /*// moved to filters (Firewall web GUI) 334 334 else if (!strcmp (service, "logging")) … … 339 339 */ 340 340 /* Sveasoft addition */ 341 else if (!strcmp (service, "router"))342 {341 else if (!strcmp (service, "router")) 342 { 343 343 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 344 startstop ("zebra");344 startstop ("zebra"); 345 345 #endif 346 346 #ifdef HAVE_OLSRD 347 startstop ("olsrd");348 #endif 349 }350 else if (!strcmp (service, "hotspot"))351 {347 startstop ("olsrd"); 348 #endif 349 } 350 else if (!strcmp (service, "hotspot")) 351 { 352 352 #ifdef HAVE_WIFIDOG 353 startstop ("wifidog");353 startstop ("wifidog"); 354 354 #endif 355 355 #ifdef HAVE_NOCAT 356 startstop ("splashd");356 startstop ("splashd"); 357 357 #endif 358 358 #ifdef HAVE_CHILLI 359 startstop ("chilli");359 startstop ("chilli"); 360 360 #endif 361 361 #ifdef HAVE_SPUTNIK_APD 362 startstop ("sputnik");363 #endif 364 eval ("/etc/config/http-redirect.firewall");365 eval ("/etc/config/smtp-redirect.firewall");366 367 }368 else if (!strcmp (service, "services"))369 {362 startstop ("sputnik"); 363 #endif 364 eval ("/etc/config/http-redirect.firewall"); 365 eval ("/etc/config/smtp-redirect.firewall"); 366 367 } 368 else if (!strcmp (service, "services")) 369 { 370 370 #ifdef HAVE_PPPOERELAY 371 startstop ("pppoerelay");372 #endif 373 startstop ("udhcpd");374 startstop ("syslog");371 startstop ("pppoerelay"); 372 #endif 373 startstop ("udhcpd"); 374 startstop ("syslog"); 375 375 #ifdef HAVE_RSTATS 376 startstop ("rstats");376 startstop ("rstats"); 377 377 #endif 378 378 #ifdef HAVE_NSTX 379 startstop ("nstxd");379 startstop ("nstxd"); 380 380 #endif 381 381 #ifdef HAVE_PPPOESERVER 382 startstop ("firewall");383 startstop ("pppoeserver");384 #endif 385 startstop ("dnsmasq");386 startstop ("udhcpd");382 startstop ("firewall"); 383 startstop ("pppoeserver"); 384 #endif 385 startstop ("dnsmasq"); 386 startstop ("udhcpd"); 387 387 #ifdef HAVE_CPUTEMP 388 start_service ("hwmon");388 start_service ("hwmon"); 389 389 #endif 390 390 #ifdef HAVE_TELNET 391 391 #ifdef HAVE_REGISTER 392 if (isregistered ())393 #endif 394 startstop ("telnetd");392 if (isregistered ()) 393 #endif 394 startstop ("telnetd"); 395 395 #endif 396 396 #ifdef HAVE_SNMP 397 startstop ("snmp");397 startstop ("snmp"); 398 398 #endif 399 399 #ifdef HAVE_OPENVPN 400 startstop ("openvpn");400 startstop ("openvpn"); 401 401 #endif 402 402 #ifdef HAVE_PPTPD 403 startstop ("pptpd");403 startstop ("pptpd"); 404 404 #endif 405 405 #ifdef HAVE_PPTP 406 eval ("/etc/config/pptpd_client.startup");406 eval ("/etc/config/pptpd_client.startup"); 407 407 #endif 408 408 #ifdef HAVE_RFLOW 409 eval ("/etc/config/rflow.startup");409 eval ("/etc/config/rflow.startup"); 410 410 #endif 411 411 #ifdef HAVE_KAID 412 eval ("/etc/config/kaid.startup");412 eval ("/etc/config/kaid.startup"); 413 413 #endif 414 414 #ifdef HAVE_SSHD 415 415 #ifdef HAVE_REGISTER 416 if (isregistered ())417 #endif 418 startstop ("sshd");419 #endif 420 startstop ("firewall");421 startstop ("syslog");416 if (isregistered ()) 417 #endif 418 startstop ("sshd"); 419 #endif 420 startstop ("firewall"); 421 startstop ("syslog"); 422 422 #ifdef HAVE_NEWMEDIA 423 startstop ("openvpnserversys");424 #endif 425 }426 else if (!strcmp (service, "management"))427 {428 #ifndef HAVE_MADWIFI 423 startstop ("openvpnserversys"); 424 #endif 425 } 426 else if (!strcmp (service, "management")) 427 { 428 #ifndef HAVE_MADWIFI 429 429 stop_service ("nas"); 430 430 #endif 431 431 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 432 stop_service ("zebra");433 #endif 434 stop_service ("cron");435 stop_service ("udhcpd");436 start_service ("udhcpd");437 start_service ("cron");432 stop_service ("zebra"); 433 #endif 434 stop_service ("cron"); 435 stop_service ("udhcpd"); 436 start_service ("udhcpd"); 437 start_service ("cron"); 438 438 #ifdef HAVE_IPV6 439 start_service ("ipv6");439 start_service ("ipv6"); 440 440 #endif 441 441 #ifdef HAVE_RADVD 442 startstop ("radvd");442 startstop ("radvd"); 443 443 #endif 444 444 #ifdef HAVE_PPTPD 445 startstop ("pptpd");445 startstop ("pptpd"); 446 446 #endif 447 447 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 448 start_service ("zebra");449 #endif 450 startstop ("firewall");451 startstop ("wshaper");452 startstop ("httpd");448 start_service ("zebra"); 449 #endif 450 startstop ("firewall"); 451 startstop ("wshaper"); 452 startstop ("httpd"); 453 453 454 454 #ifdef HAVE_WOL 455 startstop ("wol");456 #endif 457 #ifndef HAVE_MADWIFI 458 start_service ("nas");455 startstop ("wol"); 456 #endif 457 #ifndef HAVE_MADWIFI 458 start_service ("nas"); 459 459 #ifdef HAVE_MSSID 460 start_service ("guest_nas");461 #endif 462 #endif 463 464 }460 start_service ("guest_nas"); 461 #endif 462 #endif 463 464 } 465 465 466 466 /* end Sveasoft additon */ 467 else if (!strcmp (service, "start_pppoe") || !strcmp (service, "start_pptp") 468 || !strcmp (service, "start_l2tp") 469 || !strcmp (service, "start_heartbeat")) 470 { 471 unlink ("/tmp/ppp/log"); 472 #ifndef HAVE_MADWIFI 473 stop_service ("nas"); 467 else if (!strcmp (service, "start_pppoe") 468 || !strcmp (service, "start_pptp") 469 || !strcmp (service, "start_l2tp") 470 || !strcmp (service, "start_heartbeat")) 471 { 472 unlink ("/tmp/ppp/log"); 473 #ifndef HAVE_MADWIFI 474 stop_service ("nas"); 474 475 #endif 475 476 #ifdef HAVE_MADWIFI 476 stop_service ("stabridge");477 #endif 478 #ifdef HAVE_VLANTAGGING 479 stop_service ("bridgesif");480 stop_service ("vlantagging");481 #endif 482 stop_service ("lan");477 stop_service ("stabridge"); 478 #endif 479 #ifdef HAVE_VLANTAGGING 480 stop_service ("bridgesif"); 481 stop_service ("vlantagging"); 482 #endif 483 stop_service ("lan"); 483 484 #ifdef HAVE_BONDING 484 stop_service ("bonding");485 #endif 486 #ifdef HAVE_VLANTAGGING 487 stop_service ("bridging");488 #endif 489 stop_service ("wan");490 #ifdef HAVE_VLANTAGGING 491 start_service ("bridging");492 #endif 493 start_service ("lan");485 stop_service ("bonding"); 486 #endif 487 #ifdef HAVE_VLANTAGGING 488 stop_service ("bridging"); 489 #endif 490 stop_service ("wan"); 491 #ifdef HAVE_VLANTAGGING 492 start_service ("bridging"); 493 #endif 494 start_service ("lan"); 494 495 #ifdef HAVE_BONDING 495 start_service ("bonding");496 #endif 497 #ifdef HAVE_VLANTAGGING 498 start_service ("vlantagging");499 start_service ("bridgesif");500 #endif 501 start_service ("wan_boot");496 start_service ("bonding"); 497 #endif 498 #ifdef HAVE_VLANTAGGING 499 start_service ("vlantagging"); 500 start_service ("bridgesif"); 501 #endif 502 start_service ("wan_boot"); 502 503 #ifdef HAVE_MADWIFI 503 start_service ("stabridge");504 #endif 505 #ifndef HAVE_MADWIFI 506 start_service ("nas");504 start_service ("stabridge"); 505 #endif 506 #ifndef HAVE_MADWIFI 507 start_service ("nas"); 507 508 #ifdef HAVE_MSSID 508 start_service ("guest_nas");509 #endif 510 #endif 511 }512 else if (!strcmp (service, "stop_pppoe") || !strcmp (service, "stop_pptp")513 || !strcmp (service, "stop_l2tp")514 || !strcmp (service, "stop_heartbeat"))515 {516 stop_service ("wan");517 }518 else if (!strcmp (service, "filters"))519 {520 stop_service ("cron");521 startstop ("firewall");522 startstop ("syslog");523 startstop ("wshaper");524 start_service ("cron");525 startstop ("igmp_proxy");526 }527 else if (!strcmp (service, "routing"))528 {509 start_service ("guest_nas"); 510 #endif 511 #endif 512 } 513 else if (!strcmp (service, "stop_pppoe") || !strcmp (service, "stop_pptp") 514 || !strcmp (service, "stop_l2tp") 515 || !strcmp (service, "stop_heartbeat")) 516 { 517 stop_service ("wan"); 518 } 519 else if (!strcmp (service, "filters")) 520 { 521 stop_service ("cron"); 522 startstop ("firewall"); 523 startstop ("syslog"); 524 startstop ("wshaper"); 525 start_service ("cron"); 526 startstop ("igmp_proxy"); 527 } 528 else if (!strcmp (service, "routing")) 529 { 529 530 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 530 stop_service ("zebra");531 #endif 532 startstop ("firewall");533 start_service ("set_routes");531 stop_service ("zebra"); 532 #endif 533 startstop ("firewall"); 534 start_service ("set_routes"); 534 535 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 535 start_service ("zebra");536 start_service ("zebra"); 536 537 #endif 537 538 #ifdef HAVE_OLSRD 538 startstop("olsrd");539 #endif 540 }541 else if (!strcmp (service, "alive"))542 {543 eval ("/etc/config/wdswatchdog.startup");544 eval ("/etc/config/schedulerb.startup");545 eval ("/etc/config/proxywatchdog.startup");546 }547 else if (!strcmp (service, "forward"))548 {549 stop_service ("wshaper");550 stop_service ("upnp");551 stop_service ("firewall");552 start_service ("firewall");553 start_service ("upnp");554 start_service ("wshaper");555 }556 else if (!strcmp (service, "qos"))557 {558 startstop ("wshaper");559 }560 else if (!strcmp (service, "forward_upnp"))561 {539 startstop ("olsrd"); 540 #endif 541 } 542 else if (!strcmp (service, "alive")) 543 { 544 eval ("/etc/config/wdswatchdog.startup"); 545 eval ("/etc/config/schedulerb.startup"); 546 eval ("/etc/config/proxywatchdog.startup"); 547 } 548 else if (!strcmp (service, "forward")) 549 { 550 stop_service ("wshaper"); 551 stop_service ("upnp"); 552 stop_service ("firewall"); 553 start_service ("firewall"); 554 start_service ("upnp"); 555 start_service ("wshaper"); 556 } 557 else if (!strcmp (service, "qos")) 558 { 559 startstop ("wshaper"); 560 } 561 else if (!strcmp (service, "forward_upnp")) 562 { 562 563 #ifdef HAVE_UPNP 563 stop_service ("upnp");564 #endif 565 stop_service ("firewall");564 stop_service ("upnp"); 565 #endif 566 stop_service ("firewall"); 566 567 #ifdef HAVE_UPNP 567 start_service ("upnp");568 #endif 569 start_service ("firewall");570 startstop ("wshaper");571 }572 else if (!strcmp (service, "static_route_del"))573 {574 if (nvram_safe_get ("action_service_arg1"))575 {576 del_routes (nvram_safe_get ("action_service_arg1"));577 }578 }579 else if (!strcmp (service, "ddns"))580 {581 startstop ("ddns");582 nvram_set ("ddns_change", "update");583 }584 else if (!strcmp (service, "start_ping"))585 {586 char *ip = nvram_safe_get ("ping_ip");587 // use Ping.asp as a debugging console588 char cmd[256] = { 0 };589 //snprintf (cmd, sizeof (cmd), "%s > %s 2>&1 &", ip, PING_TMP);590 setenv ("PATH", "/sbin:/bin:/usr/sbin:/usr/bin", 1);568 start_service ("upnp"); 569 #endif 570 start_service ("firewall"); 571 startstop ("wshaper"); 572 } 573 else if (!strcmp (service, "static_route_del")) 574 { 575 if (nvram_safe_get ("action_service_arg1")) 576 { 577 del_routes (nvram_safe_get ("action_service_arg1")); 578 } 579 } 580 else if (!strcmp (service, "ddns")) 581 { 582 startstop ("ddns"); 583 nvram_set ("ddns_change", "update"); 584 } 585 else if (!strcmp (service, "start_ping")) 586 { 587 char *ip = nvram_safe_get ("ping_ip"); 588 // use Ping.asp as a debugging console 589 char cmd[256] = { 0 }; 590 //snprintf (cmd, sizeof (cmd), "%s > %s 2>&1 &", ip, PING_TMP); 591 setenv ("PATH", "/sbin:/bin:/usr/sbin:/usr/bin", 1); 591 592 // snprintf (cmd, sizeof (cmd), "%s 2>&1 &", ip); 592 593 // system (cmd); 593 594 594 snprintf (cmd, sizeof (cmd),595 "alias ping=\'ping -c 3\'; eval \"%s\" > %s 2>&1 &", ip,596 PING_TMP);597 system (cmd);598 599 }595 snprintf (cmd, sizeof (cmd), 596 "alias ping=\'ping -c 3\'; eval \"%s\" > %s 2>&1 &", ip, 597 PING_TMP); 598 system (cmd); 599 600 } 600 601 #ifdef HAVE_TFTP 601 else if (!strcmp (service, "tftp_upgrade"))602 {603 stop_service ("wan");604 stop_service ("httpd");602 else if (!strcmp (service, "tftp_upgrade")) 603 { 604 stop_service ("wan"); 605 stop_service ("httpd"); 605 606 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 606 stop_service ("zebra");607 stop_service ("zebra"); 607 608 #endif 608 609 #ifdef HAVE_UPNP 609 stop_service ("upnp");610 #endif 611 stop_service ("cron");612 }613 #endif 614 615 else if (!strcmp (service, "http_upgrade"))616 {617 stop_service ("wan");610 stop_service ("upnp"); 611 #endif 612 stop_service ("cron"); 613 } 614 #endif 615 616 else if (!strcmp (service, "http_upgrade")) 617 { 618 stop_service ("wan"); 618 619 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 619 stop_service ("zebra");620 stop_service ("zebra"); 620 621 #endif 621 622 #ifdef HAVE_OLSRD 622 stop_service ("olsrd");623 stop_service ("olsrd"); 623 624 #endif 624 625 #ifdef HAVE_UPNP 625 stop_service ("upnp");626 #endif 627 stop_service ("cron");628 }626 stop_service ("upnp"); 627 #endif 628 stop_service ("cron"); 629 } 629 630 #ifdef HAVE_MIKLFISH 630 else if (!strcmp (service, "milkfish"))631 {632 stop_service ("milkfish");633 start_service ("milkfish");634 }635 #endif 636 else if (!strcmp (service, "wireless"))637 {638 #ifndef HAVE_MADWIFI 639 eval ("wlconf", nvram_safe_get ("wl0_ifname"), "down");640 #endif 641 642 #ifndef HAVE_MADWIFI 643 stop_service ("nas");631 else if (!strcmp (service, "milkfish")) 632 { 633 stop_service ("milkfish"); 634 start_service ("milkfish"); 635 } 636 #endif 637 else if (!strcmp (service, "wireless")) 638 { 639 #ifndef HAVE_MADWIFI 640 eval ("wlconf", nvram_safe_get ("wl0_ifname"), "down"); 641 #endif 642 643 #ifndef HAVE_MADWIFI 644 stop_service ("nas"); 644 645 #endif 645 646 #ifdef HAVE_MADWIFI 646 stop_service ("stabridge");647 #endif 648 stop_service ("wan");649 #ifdef HAVE_VLANTAGGING 650 stop_service ("bridgesif");651 stop_service ("vlantagging");647 stop_service ("stabridge"); 648 #endif 649 stop_service ("wan"); 650 #ifdef HAVE_VLANTAGGING 651 stop_service ("bridgesif"); 652 stop_service ("vlantagging"); 652 653 #endif 653 654 #ifdef HAVE_BONDING 654 stop_service ("bonding");655 #endif 656 stop_service ("lan");657 #ifdef HAVE_VLANTAGGING 658 stop_service ("bridging");655 stop_service ("bonding"); 656 #endif 657 stop_service ("lan"); 658 #ifdef HAVE_VLANTAGGING 659 stop_service ("bridging"); 659 660 #endif 660 661 #ifndef HAVE_MSSID 661 if (nvram_match ("wl_akm", "wpa") ||662 nvram_match ("wl_akm", "psk") ||663 nvram_match ("wl_akm", "psk2") ||664 nvram_match ("wl_akm", "wpa2") ||665 nvram_match ("wl_akm", "psk psk2") ||666 nvram_match ("wl_akm", "wpa wpa2") ||667 nvram_match ("wl_akm", "radius"))668 sleep (4);669 #endif 670 #ifndef HAVE_MADWIFI 671 start_service ("wlconf");672 #endif 673 #ifdef HAVE_VLANTAGGING 674 start_service ("bridging");675 #endif 676 start_service ("lan");662 if (nvram_match ("wl_akm", "wpa") || 663 nvram_match ("wl_akm", "psk") || 664 nvram_match ("wl_akm", "psk2") || 665 nvram_match ("wl_akm", "wpa2") || 666 nvram_match ("wl_akm", "psk psk2") || 667 nvram_match ("wl_akm", "wpa wpa2") || 668 nvram_match ("wl_akm", "radius")) 669 sleep (4); 670 #endif 671 #ifndef HAVE_MADWIFI 672 start_service ("wlconf"); 673 #endif 674 #ifdef HAVE_VLANTAGGING 675 start_service ("bridging"); 676 #endif 677 start_service ("lan"); 677 678 #ifdef HAVE_BONDING 678 start_service ("bonding");679 #endif 680 #ifdef HAVE_VLANTAGGING 681 start_service ("vlantagging");682 start_service ("bridgesif");683 #endif 684 start_service ("wan");679 start_service ("bonding"); 680 #endif 681 #ifdef HAVE_VLANTAGGING 682 start_service ("vlantagging"); 683 start_service ("bridgesif"); 684 #endif 685 start_service ("wan"); 685 686 #ifdef HAVE_MADWIFI 686 start_service ("stabridge");687 #endif 688 #ifndef HAVE_MADWIFI 689 start_service ("nas");687 start_service ("stabridge"); 688 #endif 689 #ifndef HAVE_MADWIFI 690 start_service ("nas"); 690 691 #ifdef HAVE_MSSID 691 start_service ("guest_nas");692 #endif 693 #endif 694 startstop ("httpd"); //httpd will not accept connection anymore on wan/lan ip changes changes695 696 }697 else if (!strcmp (service, "wireless_2"))698 {699 stop_service ("radio_timer");700 #ifndef HAVE_MADWIFI 701 eval ("wlconf", nvram_safe_get ("wl0_ifname"), "down");702 #endif 703 704 #ifndef HAVE_MADWIFI 705 stop_service ("nas");692 start_service ("guest_nas"); 693 #endif 694 #endif 695 startstop ("httpd"); //httpd will not accept connection anymore on wan/lan ip changes changes 696 697 } 698 else if (!strcmp (service, "wireless_2")) 699 { 700 stop_service ("radio_timer"); 701 #ifndef HAVE_MADWIFI 702 eval ("wlconf", nvram_safe_get ("wl0_ifname"), "down"); 703 #endif 704 705 #ifndef HAVE_MADWIFI 706 stop_service ("nas"); 706 707 #endif 707 708 #ifdef HAVE_MADWIFI 708 stop_service ("stabridge");709 #endif 710 if (nvram_match ("wl0_mode", "sta") 711 || nvram_match ("wl0_mode", "apsta")712 || nvram_match ("wl0_mode", "apstawet"))713 stop_service ("wan");714 #ifdef HAVE_VLANTAGGING 715 stop_service ("bridgesif");716 stop_service ("vlantagging");709 stop_service ("stabridge"); 710 #endif 711 if (nvram_match ("wl0_mode", "sta") 712 || nvram_match ("wl0_mode", "apsta") 713 || nvram_match ("wl0_mode", "apstawet")) 714 stop_service ("wan"); 715 #ifdef HAVE_VLANTAGGING 716 stop_service ("bridgesif"); 717 stop_service ("vlantagging"); 717 718 #endif 718 719 #ifdef HAVE_BONDING 719 stop_service ("bonding");720 #endif 721 stop_service ("lan");722 #ifdef HAVE_VLANTAGGING 723 stop_service ("bridging");720 stop_service ("bonding"); 721 #endif 722 stop_service ("lan"); 723 #ifdef HAVE_VLANTAGGING 724 stop_service ("bridging"); 724 725 #endif 725 726 #ifndef HAVE_MSSID 726 if (nvram_match ("wl_akm", "wpa") ||727 nvram_match ("wl_akm", "psk") ||728 nvram_match ("wl_akm", "psk2") ||729 nvram_match ("wl_akm", "wpa2") ||730 nvram_match ("wl_akm", "psk psk2") ||731 nvram_match ("wl_akm", "wpa wpa2") ||732 nvram_match ("wl_akm", "radius"))733 sleep (4);734 #endif 735 #ifndef HAVE_MADWIFI 736 start_service ("wlconf");737 #endif 738 #ifdef HAVE_VLANTAGGING 739 start_service ("bridging");740 #endif 741 start_service ("lan");727 if (nvram_match ("wl_akm", "wpa") || 728 nvram_match ("wl_akm", "psk") || 729 nvram_match ("wl_akm", "psk2") || 730 nvram_match ("wl_akm", "wpa2") || 731 nvram_match ("wl_akm", "psk psk2") || 732 nvram_match ("wl_akm", "wpa wpa2") || 733 nvram_match ("wl_akm", "radius")) 734 sleep (4); 735 #endif 736 #ifndef HAVE_MADWIFI 737 start_service ("wlconf"); 738 #endif 739 #ifdef HAVE_VLANTAGGING 740 start_service ("bridging"); 741 #endif 742 start_service ("lan"); 742 743 #ifdef HAVE_BONDING 743 start_service ("bonding");744 #endif 745 #ifdef HAVE_VLANTAGGING 746 start_service ("vlantagging");747 start_service ("bridgesif");748 #endif 749 if (nvram_match ("wl0_mode", "sta") 750 || nvram_match ("wl0_mode", "apsta")751 || nvram_match ("wl0_mode", "apstawet"))752 start_service ("wan");744 start_service ("bonding"); 745 #endif 746 #ifdef HAVE_VLANTAGGING 747 start_service ("vlantagging"); 748 start_service ("bridgesif"); 749 #endif 750 if (nvram_match ("wl0_mode", "sta") 751 || nvram_match ("wl0_mode", "apsta") 752 || nvram_match ("wl0_mode", "apstawet")) 753 start_service ("wan"); 753 754 #ifdef HAVE_MADWIFI 754 start_service ("stabridge");755 #endif 756 #ifndef HAVE_MADWIFI 757 start_service ("nas");755 start_service ("stabridge"); 756 #endif 757 #ifndef HAVE_MADWIFI 758 start_service ("nas"); 758 759 #ifdef HAVE_MSSID 759 start_service ("guest_nas");760 #endif 761 #endif 762 start_service ("radio_timer");763 if (nvram_match ("wl0_mode", "sta") 764 || nvram_match ("wl0_mode", "apsta")765 || nvram_match ("wl0_mode", "apstawet"))766 startstop ("httpd");//httpd will not accept connection anymore on wan/lan ip changes changes767 }768 else if (!strcmp (service, "dhcp_release"))769 {770 char sigusr[] = "-XX";771 sprintf (sigusr, "-%d", SIGUSR2);772 //killps("udhcpc",sigusr);773 killall ("udhcpc", sigusr);774 sleep (1);775 }760 start_service ("guest_nas"); 761 #endif 762 #endif 763 start_service ("radio_timer"); 764 if (nvram_match ("wl0_mode", "sta") 765 || nvram_match ("wl0_mode", "apsta") 766 || nvram_match ("wl0_mode", "apstawet")) 767 startstop ("httpd"); //httpd will not accept connection anymore on wan/lan ip changes changes 768 } 769 else if (!strcmp (service, "dhcp_release")) 770 { 771 char sigusr[] = "-XX"; 772 sprintf (sigusr, "-%d", SIGUSR2); 773 //killps("udhcpc",sigusr); 774 killall ("udhcpc", sigusr); 775 sleep (1); 776 } 776 777 #ifdef HAVE_EOP_TUNNEL 777 else if (!strcmp (service, "eop"))778 {779 eval ("/etc/config/eop-tunnel.startup");780 eval ("/etc/config/eop-tunnel.firewall");781 }778 else if (!strcmp (service, "eop")) 779 { 780 eval ("/etc/config/eop-tunnel.startup"); 781 eval ("/etc/config/eop-tunnel.firewall"); 782 } 782 783 #endif 783 784 }
Note: See TracChangeset
for help on using the changeset viewer.
