Article 575T5 [SOLVED] recommended way of modifying /etc/rc.d/rc.M from a script?

[SOLVED] recommended way of modifying /etc/rc.d/rc.M from a script?

by
FlinchX
from LinuxQuestions.org on (#575T5)
I need to modify /etc/rc.d/rc.M and add a generic startup block for a third party daemon:

Code:if [ -x /etc/rc.d/rc.foo ]; then
/etc/rc.d/rc.foo start
fiWhat is the recommended way to do this from a script?

I can't just append the block to the end of the file, because I need to insert it in a custom location (order of daemons matter sometimes, since some rely on others already running).

I don't like the idea of doing it by hand, make a diff then just apply the patch to the default rc.M script, because it does not scale well for multiple similar actions.

Currently I'm leaning towards reading rc.M line by line until I find the location where I need to add my block, add it then add the rest of original rc.M below - basically emulating how would I do it manually.

Are there any other less obvious approaches that Slackware users use to solve this generic problem?latest?d=yIl2AUoC8zA latest?i=xN27aQynA3s:WNI-xz0X0EM:F7zBnMy latest?i=xN27aQynA3s:WNI-xz0X0EM:V_sGLiP latest?d=qj6IDK7rITs latest?i=xN27aQynA3s:WNI-xz0X0EM:gIN9vFwxN27aQynA3s
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments