[Ewrt-devel] Re: Patch for rc_startup & rc_shutdown
Irving Popovetsky
Thu May 6 10:54:45 PDT 2004
Hi Joseba, thanks for the patch!
I don't see any mention of rc_startup and rc_shutdown anywhere in the
code. Based on your patch I'm guessing they function kindof like an
rc.local script.
Can you provide more information about these variables? documentation?
would you be willing to write a web interface to control them?
Thanks,
-Irving
On Thu, 2004-05-06 at 01:30, Joseba Beltran wrote:
> Hi all,
>
> Hope you find my patch useful. I've just added it to your release
> and fix the rc_startup and rc_shutdown nvram scripts. Now they run like a
> charm at booting and stoping
>
> ------------------------------ cut ----------------------------------
> --- src/router/rc.bak/rc.c 2004-04-27 01:37:27.000000000 +0200
> +++ src/router/rc/rc.c 2004-05-06 10:20:24.000000000 +0200
> @@ -79,8 +79,31 @@
> static int init_nvram(void);
> static int check_image(void);
>
> +
> extern struct nvram_tuple router_defaults[];
>
> +static int create_rc_startup(char* str)
> +{
> + if(str)
> + nvram_set("rc_startup", str);
> +
> + nvram2file("rc_startup", "/tmp/.rc_startup");
> + chmod("/tmp/.rc_startup", 0700);
> +
> + return 0;
> +}
> +
> +static int create_rc_shutdown(char* str)
> +{
> + if(str)
> + nvram_set("rc_shutdown", str);
> +
> + nvram2file("rc_shutdown", "/tmp/.rc_shutdown");
> + chmod("/tmp/.rc_shutdown", 0700);
> +
> + return 0;
> +}
> +
> static void
> restore_defaults(void)
> {
> @@ -310,6 +333,8 @@
> state = IDLE;
> break;
> }
> + create_rc_shutdown(NULL);
> + system("/tmp/.rc_shutdown");
> /* Fall through */
> case START:
> dprintf("START\n");
> @@ -321,6 +346,8 @@
> start_nas("wan");
> start_syslog();
> start_splashd();
> + create_rc_startup(NULL);
> + system("/tmp/.rc_startup");
> /* Fall through */
> case TIMER:
> dprintf("TIMER\n");
>
> ------------------------------ cut ----------------------------------
>
>
>
> All the best,
>
> Joseba Beltrán
> jbeltran at sarematica.com
>
> ---
> Saremática, S.L. - EuskalWireless©
> http://www.sarematica.com
> Tlf : 943 42 16 04
> Fax : 943 42 30 09
--
Irving Popovetsky Information Security Consultant
ProStructure Consulting http://www.prostructure.com
Network and Security Consulting phone: (503) 288-1566
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://portless.net/pipermail/ewrt-devel/attachments/20040506/b02389c5/attachment.bin
More information about the Ewrt-devel mailing list