Hey Benoit,

I tried this, and it works, but during the time of building, it sets the
crontab of the hostmachine, not the one inside the image I'm building?

I guess that the ipkg will set the crontab correctly when I install the
package as an external package on the router, but how can I add this to the
image?


My command is :
define Package/cron_prog/postinst
#!/bin/sh
# Get statistics every minute
(crontab -l 2>/dev/null | grep -v cron_prog; echo "* * * * *
/bin/cron_prog") | crontab - 2>/dev/null
exit 0
endef



Thanks!


2008/7/16 Benoît Ganne <[EMAIL PROTECTED]>:

> > How is it possible to create a crontab entry while creating a package?
> [...]
> > But I would like to do it at such time that the crontab is already
> > modified on the firmware image?
>
> I'm not sure to understand: you just want to add a crontab entry at
> package installation time, right ?
> If so, you can use the target Package/packagename/postinst to add such
> entry with a little shell script.
> You can see an example here:
>
> https://dev.openwrt.org/cgi-bin/trac.fcgi/browser/packages/admin/muninlite/Makefile
> This package add entries to /etc/inetd.conf and /etc/services at
> installation time.
> In fact, what's directly under such target (until the keyword 'endef' is
> encountered) will be copied verbatim as a post-install script in your
> package at build time.
>
> Cheers,
> ben
>
> --
> *Benoît GANNE*
> /jabber: [EMAIL PROTECTED]/
> /icq: 138217861/
> /msn: [EMAIL PROTECTED]/
> --
> ...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and
> the Ugly).
>         -- Matt Welsh
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to